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

Svend Vanderveken commented on FLINK-17446:
-------------------------------------------

We'd be grateful if that feature was added to Flink.

For info, as a temporary workaround I'm currently writing queries similar to 
the one below, which is not ideal since the state would then grow continuously 
with each new {{time_period_start}}. 

I'd be happy to contribute some testing if/when work start on this feature.

{code:sql}

WITH windowed AS ( 
 SELECT 
   FLOOR(creation_time TO MINUTE) as time_period_start, 
   field_1,  
   field_2
 FROM flat_post_events_view), 
 
 SELECT 
    time_period_start, 
    field_1, 
    field_1, 
    count(1) as total_count 
 FROM windowed 
 GROUP BY 
 GROUPING SETS ( 
   (time_period_start, field_1), 
   (time_period_start, field_2), 
   (time_period_start, field_1, field_2)
 ) 
 
{code}




> Blink supports cube and window together in group by
> ---------------------------------------------------
>
>                 Key: FLINK-17446
>                 URL: https://issues.apache.org/jira/browse/FLINK-17446
>             Project: Flink
>          Issue Type: New Feature
>          Components: API / Core
>            Reporter: Liu
>            Priority: Minor
>
>       Blink planner supports CUBE. CUBE can be used together with a field but 
> not window. For example, the following SQL is not supported:
>  
>        SELECT A, B, sum(C)
>        FROM person
>        GROUP BY cube(A, B), TUMBLE(curTimestamp, interval '1' minute)
>   
>        It is a missing feature. Maybe it should be supported. Detail is in 
> [http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Blink-window-and-cube-td34761.html#a34768]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to