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_r353844426
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
##########
@@ -186,7 +186,12 @@ object ScalarOperatorGens {
case (TIME_WITHOUT_TIME_ZONE, INTERVAL_DAY_TIME) =>
generateOperatorIfNotNull(ctx, new TimeType(), left, right) {
- (l, r) => s"$l $op ((int) ($r))"
+ (l, r) => s"java.lang.Math.toIntExact(($l $op $r) %
${MILLIS_PER_DAY}L)"
Review comment:
should be
```
(l, r) => s"$l $op (java.lang.Math.toIntExact($r % ${MILLIS_PER_DAY}L)))"
```
to make it consistent with the table-planner one?
----------------------------------------------------------------
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