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