You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2015/07/11 18:05:04 UTC

[jira] [Comment Edited] (CASSANDRA-9778) CQL support for time series aggregation

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

Jonathan Ellis edited comment on CASSANDRA-9778 at 7/11/15 4:04 PM:
--------------------------------------------------------------------

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" can of worms.  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/]



was (Author: jbellis):
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)