[ 
https://issues.apache.org/jira/browse/CASSANDRA-9778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623463#comment-14623463
 ] 

Jonathan Ellis commented on CASSANDRA-9778:
-------------------------------------------

The (1h) syntax here is inspired by 
[influxdb's|https://influxdb.com/docs/v0.9/concepts/continuous_queries.html].

In general I prefer using actual SQL syntax where possible instead of inventing 
our own, but SQL windowing functions are much broader than what we would 
support here and I'd rather not open up the "why do you support query X but not 
similar query Y" if possible.  Or as Baron Schwartz puts it, ["(SQL windowing 
functions and CTEs) gets you part of the way there, but it’s extremely awkward; 
the syntax is at right angles to the 
intent"|http://www.xaprb.com/blog/2014/03/02/time-series-databases-influxdb/]


> CQL support for time series aggregation
> ---------------------------------------
>
>                 Key: CASSANDRA-9778
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9778
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>             Fix For: 3.x
>
>
> Along with MV (CASSANDRA-6477), time series aggregation or "rollups" are a 
> common design pattern in cassandra applications.  I'd like to add CQL support 
> for this along these lines:
> {code}
> CREATE MATERIALIZED VIEW stocks_by_hour AS
> SELECT exchange, day, day_time(1h) AS hour, symbol, avg(price), sum(volume)
> FROM stocks
> GROUP BY exchange, day, symbol, hour
> PRIMARY KEY  ((exchange, day), hour, symbol);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to