lamber-ken commented on a change in pull request #7180: [FLINK-11010] [TABLE] 
Flink SQL timestamp is inconsistent with currentProcessingTime()
URL: https://github.com/apache/flink/pull/7180#discussion_r244447701
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala
 ##########
 @@ -1449,6 +1449,7 @@ abstract class CodeGenerator(
     val resultCode =
       s"""
         |long $resultTerm = 
$contextTerm.timerService().currentProcessingTime();
+        |$resultTerm = $resultTerm + 
java.util.TimeZone.getDefault().getOffset($resultTerm);
 
 Review comment:
   > Thanks for your pr. We can't add the offset here. The long type time has 
already take timezone into consideration. The result is wrong if we output the 
long value directly.
   
   I add the offset follow here [add 
offset](https://github.com/apache/flink/blob/33f6d067225967c8335c0d61920c19a00dd62786/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala#L1761)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to