You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by fhueske <gi...@git.apache.org> on 2017/02/02 22:44:16 UTC

[GitHub] flink issue #3252: [FLINK-5624] Support tumbling window on streaming tables ...

Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/3252
  
    Hi @haohui, thanks for your contribution!
    
    The referenced JIRA is about adding support for group windows to SQL, not OVER (or row) windows. It should enable queries such as:
    
    ```
    SELECT a, sum(b) as sumB, TUMBLE_END(rowtime(), INTERVAL '1' HOUR) AS t,
      FROM myT
    GROUP BY TUMBLE(rowtime(), INTERVAL '1' HOUR), a;
    ```
    
    I saw that you contributed `TUMBLE` just very recently to Calcite, so this feature is not yet available in a Calcite release that we could link against. Until then, we could add support for the more manual version of SQL tumbling windows:
    
    ```
    SELECT a, SUM(b) AS sumB, CEIL(rowtime() TO HOUR) AS t,
      FROM myT
    GROUP BY CEIL(rowtime() TO HOUR), a
    ```
    
    We would also need to find a way to reference the `rowtime`. We do not want to expose this as an actual attribute in Flink's SQL (internally, Flink treats record timestamps as metadata which may not be modified by a query). The current approach would be to implement a built-in function which serves as a marker and is replaced during the translation.
    
    Best, Fabian


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---