As I known, MySQL supports timestampdiff directly, PG and Oracle allow
datetime subtraction that the format of the result is "XX days HH:mm:ss", Spark
SQL and Hive SQL support datediff function. And maybe we can use unix_timestamp
instead to get datetime subtraction result in seconds for Spark
I think you have identified the issues correctly.
I prefer SqlDatetimeSubtractionOperator to SqlTimestampDiffFunction because it
is standard and more powerful. But some work is needed to make SQL generation
run smoothly. Especially with data types, as you point out.
I would approach this by
Dear All,
As for issue https://issues.apache.org/jira/browse/CALCITE-3312(I'm working on
this issue), I have noticed several problems. So I am writing this mail for
some advices.
1.Calcite support the syntax like that "(datetime - datetime)
IntervalQualifier";
A simple test in JdbcTest: