[jira] [Commented] (FLINK-16823) The functioin TIMESTAMPDIFF doesn't perform expected result

2020-03-31 Thread Zhenghua Gao (Jira)


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

Zhenghua Gao commented on FLINK-16823:
--

After talk with [~danny0405], we decide to introduce addMonths/subtractMonths 
as a temporary solution on Flink side to fix this corner case before 
CALCITE-3881 is fixed.

> The functioin TIMESTAMPDIFF doesn't perform expected result
> ---
>
> Key: FLINK-16823
> URL: https://issues.apache.org/jira/browse/FLINK-16823
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Planner
>Affects Versions: 1.9.1, 1.10.0
>Reporter: Adam N D DENG
>Assignee: Zhenghua Gao
>Priority: Major
>  Labels: pull-request-available
> Attachments: image-2020-03-27-13-50-51-955.png
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> For example,
> In mysql bellow sql get result 6, but in flink the output is 5
> SELECT timestampdiff (MONTH, TIMESTAMP '2019-09-01 00:00:00',TIMESTAMP 
> '2020-03-01 00:00:00' )
>  
> !image-2020-03-27-13-50-51-955.png!
>  
>  



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


[jira] [Commented] (FLINK-16823) The functioin TIMESTAMPDIFF doesn't perform expected result

2020-03-27 Thread Zhenghua Gao (Jira)


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

Zhenghua Gao commented on FLINK-16823:
--

[~danny0405] What the plan of the upgrading of Calcite? Should we also upgrade 
calcite-avatica?

> The functioin TIMESTAMPDIFF doesn't perform expected result
> ---
>
> Key: FLINK-16823
> URL: https://issues.apache.org/jira/browse/FLINK-16823
> Project: Flink
>  Issue Type: Bug
>Affects Versions: 1.9.1, 1.10.0
>Reporter: Adam N D DENG
>Assignee: Zhenghua Gao
>Priority: Major
> Attachments: image-2020-03-27-13-50-51-955.png
>
>
> For example,
> In mysql bellow sql get result 6, but in flink the output is 5
> SELECT timestampdiff (MONTH, TIMESTAMP '2019-09-01 00:00:00',TIMESTAMP 
> '2020-03-01 00:00:00' )
>  
> !image-2020-03-27-13-50-51-955.png!
>  
>  



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


[jira] [Commented] (FLINK-16823) The functioin TIMESTAMPDIFF doesn't perform expected result

2020-03-27 Thread Zhenghua Gao (Jira)


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

Zhenghua Gao commented on FLINK-16823:
--

The root cause is CALCITE-3881, will fix on calcite side.

> The functioin TIMESTAMPDIFF doesn't perform expected result
> ---
>
> Key: FLINK-16823
> URL: https://issues.apache.org/jira/browse/FLINK-16823
> Project: Flink
>  Issue Type: Bug
>Affects Versions: 1.9.1, 1.10.0
>Reporter: Adam N D DENG
>Assignee: Zhenghua Gao
>Priority: Major
> Attachments: image-2020-03-27-13-50-51-955.png
>
>
> For example,
> In mysql bellow sql get result 6, but in flink the output is 5
> SELECT timestampdiff (MONTH, TIMESTAMP '2019-09-01 00:00:00',TIMESTAMP 
> '2020-03-01 00:00:00' )
>  
> !image-2020-03-27-13-50-51-955.png!
>  
>  



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


[jira] [Commented] (FLINK-16823) The functioin TIMESTAMPDIFF doesn't perform expected result

2020-03-27 Thread Zhenghua Gao (Jira)


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

Zhenghua Gao commented on FLINK-16823:
--

Flink use Calcite's SqlFunctions#subtractMonths to find the number of month 
between two dates/timestamps.

There may be a bug in the algorithm of SqlFunctions#subtractMonths. 

Will dig deeper to find the root cause and fix.

 

> The functioin TIMESTAMPDIFF doesn't perform expected result
> ---
>
> Key: FLINK-16823
> URL: https://issues.apache.org/jira/browse/FLINK-16823
> Project: Flink
>  Issue Type: Bug
>Affects Versions: 1.9.1, 1.10.0
>Reporter: Adam N D DENG
>Assignee: Zhenghua Gao
>Priority: Major
> Attachments: image-2020-03-27-13-50-51-955.png
>
>
> For example,
> In mysql bellow sql get result 6, but in flink the output is 5
> SELECT timestampdiff (MONTH, TIMESTAMP '2019-09-01 00:00:00',TIMESTAMP 
> '2020-03-01 00:00:00' )
>  
> !image-2020-03-27-13-50-51-955.png!
>  
>  



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


[jira] [Commented] (FLINK-16823) The functioin TIMESTAMPDIFF doesn't perform expected result

2020-03-27 Thread Zhenghua Gao (Jira)


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

Zhenghua Gao commented on FLINK-16823:
--

OK, i will take a look at it.

> The functioin TIMESTAMPDIFF doesn't perform expected result
> ---
>
> Key: FLINK-16823
> URL: https://issues.apache.org/jira/browse/FLINK-16823
> Project: Flink
>  Issue Type: Bug
>Affects Versions: 1.9.1, 1.10.0
>Reporter: Adam N D DENG
>Priority: Major
> Attachments: image-2020-03-27-13-50-51-955.png
>
>
> For example,
> In mysql bellow sql get result 6, but in flink the output is 5
> SELECT timestampdiff (MONTH, TIMESTAMP '2019-09-01 00:00:00',TIMESTAMP 
> '2020-03-01 00:00:00' )
>  
> !image-2020-03-27-13-50-51-955.png!
>  
>  



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


[jira] [Commented] (FLINK-16823) The functioin TIMESTAMPDIFF doesn't perform expected result

2020-03-27 Thread Kurt Young (Jira)


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

Kurt Young commented on FLINK-16823:


Yes, this is a bug. [~docete] could you take a look at this?

> The functioin TIMESTAMPDIFF doesn't perform expected result
> ---
>
> Key: FLINK-16823
> URL: https://issues.apache.org/jira/browse/FLINK-16823
> Project: Flink
>  Issue Type: Bug
>Affects Versions: 1.9.1, 1.10.0
>Reporter: Adam N D DENG
>Priority: Major
> Attachments: image-2020-03-27-13-50-51-955.png
>
>
> For example,
> In mysql bellow sql get result 6, but in flink the output is 5
> SELECT timestampdiff (MONTH, TIMESTAMP '2019-09-01 00:00:00',TIMESTAMP 
> '2020-03-01 00:00:00' )
>  
> !image-2020-03-27-13-50-51-955.png!
>  
>  



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