walterddr commented on a change in pull request #8746:
[hotfix][FLINK-11120][table]fix the bug of timestampadd handles time
URL: https://github.com/apache/flink/pull/8746#discussion_r353280843
##########
File path:
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/codegen/calls/ScalarOperators.scala
##########
@@ -909,7 +909,15 @@ object ScalarOperators {
case (SqlTimeTypeInfo.TIME, TimeIntervalTypeInfo.INTERVAL_MILLIS) =>
generateOperatorIfNotNull(nullCheck, SqlTimeTypeInfo.TIME, left,
right) {
- (l, r) => s"$l $op ((int) ($r))"
+ (l, r) =>
+ s"((($l % ${MILLIS_PER_DAY} == 0) ? ${MILLIS_PER_DAY} : $l) " +
+ s"+ (java.lang.Math.toIntExact($r % ${MILLIS_PER_DAY} == 0 ? 0 :
$r))) " +
+ s"% ${MILLIS_PER_DAY}"
+ }
Review comment:
this case branch is missing the `$op`. I am assuming that's not expected ?
(I also saw a `+` sign on line 914 which shouldn't be there)
is this branch tested?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services