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_r351532182
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
##########
@@ -171,7 +171,7 @@ object ScalarOperatorGens {
resultType.getTypeRoot match {
case DATE =>
generateOperatorIfNotNull(ctx, new DateType(), left, right) {
- (l, r) => s"$l $op ((int) ($r / ${MILLIS_PER_DAY}L))"
+ (l, r) => s"$l $op (Math.toIntExact($r / ${MILLIS_PER_DAY}L))"
Review comment:
`java.lang.Math.toIntExact`. better use the full qualified name during
codegen IMO
----------------------------------------------------------------
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