You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Leonard Xu (Jira)" <ji...@apache.org> on 2021/04/08 11:47:00 UTC

[jira] [Updated] (CALCITE-4563) Allow auxiliary SqlGroupedWindowFunction to specify returnTypeInference

     [ https://issues.apache.org/jira/browse/CALCITE-4563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonard Xu updated CALCITE-4563:
--------------------------------
    Description: 
in CALCITE-2133 we allowed SqlGroupedWindowFunction to specify returnTypeInference in its constructor, but for auxiliary SqlGroupedWindowFunction, the returnTypeInference is fixed as *ReturnTypes.ARG0*, we can also enable user to config it.

 

To resolve the day light saving time issue in window, our approach in Flink is using TIMESTAMP type for *TUMBLE_START*, *TUMBLE_END*  and use TIMESTAMP WITH LOCAL TIME ZONE type for the *TUMBLE*.  **   In this way, the window [2021-03-14 00:00:00  2021-03-14 00:04:00] will collect 3 hours data in Los_angele timezone, but it collect 4 hours data in other non-DST timezone.
{code:java}
// The DaylightTime in Los_Angele start at time 2021-03-14 02:00:00
long epoch1 = 1615708800000L; // 2021-03-14 00:00:00
long epoch2 = 1615712400000L; // 2021-03-14 01:00:00
long epoch3 = 1615716000000L; // 2021-03-14 03:00:00, skip one hour (2021-03-14 02:00:00)
long epoch4 = 1615719600000L; // 2021-03-14 04:00:00
{code}
From the example we know we want to split the window in timestamp literal  which means we want to use TIMESTAMP for no matter the SqlGroupedWindowFunction  

 

 

  was:
in CALCITE-2133 we allowed SqlGroupedWindowFunction to specify returnTypeInference in its constructor, but for auxiliary SqlGroupedWindowFunction, the returnTypeInference is fixed as *ReturnTypes.ARG0*, we can also enable user to config it.

 

To resolve the day light saving time issue in window, our approach in Flink is using TIMESTAMP type for *TUMBLE_START*, *TUMBLE_END*  and use TIMESTAMP WITH LOCAL TIME ZONE type for the *TUMBLE*.  **   In this way, the window [2021-03-14 00:00:00  2021-03-14 00:04:00] will collect 3 hours data in Los_angele timezone, but it collect 4 hours data in other non-DST timezone.
{code:java}
// The DaylightTime in Los_Angele start at time 2021-03-14 02:00:00
long epoch1 = 1615708800000L; // 2021-03-14 00:00:00
long epoch2 = 1615712400000L; // 2021-03-14 01:00:00
long epoch3 = 1615716000000L; // 2021-03-14 03:00:00, skip one hour (2021-03-14 02:00:00)
long epoch4 = 1615719600000L; // 2021-03-14 04:00:00
{code}
From the example we know we want to split the window in timestamp literal no matter the window  

 

 


> Allow auxiliary SqlGroupedWindowFunction to specify returnTypeInference 
> ------------------------------------------------------------------------
>
>                 Key: CALCITE-4563
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4563
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Leonard Xu
>            Priority: Minor
>
> in CALCITE-2133 we allowed SqlGroupedWindowFunction to specify returnTypeInference in its constructor, but for auxiliary SqlGroupedWindowFunction, the returnTypeInference is fixed as *ReturnTypes.ARG0*, we can also enable user to config it.
>  
> To resolve the day light saving time issue in window, our approach in Flink is using TIMESTAMP type for *TUMBLE_START*, *TUMBLE_END*  and use TIMESTAMP WITH LOCAL TIME ZONE type for the *TUMBLE*.  **   In this way, the window [2021-03-14 00:00:00  2021-03-14 00:04:00] will collect 3 hours data in Los_angele timezone, but it collect 4 hours data in other non-DST timezone.
> {code:java}
> // The DaylightTime in Los_Angele start at time 2021-03-14 02:00:00
> long epoch1 = 1615708800000L; // 2021-03-14 00:00:00
> long epoch2 = 1615712400000L; // 2021-03-14 01:00:00
> long epoch3 = 1615716000000L; // 2021-03-14 03:00:00, skip one hour (2021-03-14 02:00:00)
> long epoch4 = 1615719600000L; // 2021-03-14 04:00:00
> {code}
> From the example we know we want to split the window in timestamp literal  which means we want to use TIMESTAMP for no matter the SqlGroupedWindowFunction  
>  
>  



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