SEPURI-SAI-KRISHNA commented on PR #29366:
URL: https://github.com/apache/flink/pull/29366#issuecomment-7235240930

   Agree that old plans shouldn't change. But a version on `TIMESTAMPDIFF` 
wouldn't do it, since a plan compiled from SQL doesn't contain `TIMESTAMPDIFF`. 
Calcite rewrites it into a datetime minus, so the plan stores `$-$1`.
   
   What would work is casting both `TIME` operands to `TIMESTAMP` in 
`FlinkConvertletTable` for the year and month units. Both get the same date, so 
it cancels out. Old plans keep returning what they return today, new plans get 
0. Only `MONTH` with an earlier second argument still gives -1, the same as for 
`TIMESTAMP` today, which is FLINK-41596.
   
   I'll drop the `TIME` with `DATE`/`TIMESTAMP` cases from this PR and leave 
them for a separate ticket.
   
   Would that work for you?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to