[ https://issues.apache.org/jira/browse/FLINK-7235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16793786#comment-16793786 ]
Rong Rong commented on FLINK-7235: ---------------------------------- This {{DateTimeUtils}} is still needed, but in a very different way. Originally the time operation was not correctly done via the {{ymdToJulian}} function before the date {{1970-01-01}} thus we need the fix. similar to addressing this problem: {code:java} Optimized :1017-12-05 22:58:58.998 Expected :1017-11-29 22:58:58.998 Actual :1017-12-05 22:58:58.998 {code} However, after pulling in avatica 1.13, I found out that the optimized plans of the time operations are actually correct. it is in fact the casting part that creates problem: For example, the following: *{{(plus(-12000.months, cast('2017-11-29 22:58:58.998', TIMESTAMP))}}* result in a StringTestExpression of: *{{CAST(1017-11-29 22:58:58.998):VARCHAR(65536) CHARACTER SET "UTF-16LE" COLLATE "ISO-8859-1$en_US$primary" NOT NULL}}* But the testing results are: {code:java} Optimized :1017-11-29 22:58:58.998 Expected :1017-11-29 22:58:58.998 Actual :1017-11-23 22:58:58.998 {code} I will close this ticket and create another 2 for addressing out-of-sync calcite/avatica pull-ins. there also another \{{AuxiliaryConverter}} class that is suppose to be removed onceĀ CALCITE-1761 is fixed > Backport CALCITE-1884 to the Flink repository before Calcite 1.14 > ----------------------------------------------------------------- > > Key: FLINK-7235 > URL: https://issues.apache.org/jira/browse/FLINK-7235 > Project: Flink > Issue Type: Sub-task > Components: API / Table SQL > Reporter: Haohui Mai > Assignee: Rong Rong > Priority: Major > > We need to backport CALCITE-1884 in order to unblock upgrading Calcite to > 1.13. -- This message was sent by Atlassian JIRA (v7.6.3#76005)