You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/04 17:45:35 UTC

[GitHub] [flink] XuQianJin-Stars commented on a change in pull request #8746: [hotfix][FLINK-11120][table]fix the bug of timestampadd handles time

XuQianJin-Stars 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_r353889601
 
 

 ##########
 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?
   
   Let me change it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services