Re: Expected conversion for TIMESTAMPDIFF

2019-09-04 Thread Julian Hyde
Why the division by 12? The SQL in that bug contains “YEAR”: {fn TIMESTAMPDIFF(SQL_TSI_YEAR,TIMESTAMP '2016-01-01 00:00:00', TIMESTAMP '2017-01-01 00:00:00’)} So I presume that we are computing the difference in months, then dividing by 12 to get years. (There are two fundamental kinds of

Expected conversion for TIMESTAMPDIFF

2019-08-30 Thread Pavel Gubin
Trying to understand expected conversion to SQL for TIMESTAMPDIFF function. According to this bug: https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-3312 it is converted to something like: