docete commented on a change in pull request #10399: 
[FLINK-14959][table-planner-blink] Support precision of LocalZonedTimestampType 
in blink planner
URL: https://github.com/apache/flink/pull/10399#discussion_r354219117
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/RexNodeExtractor.scala
 ##########
 @@ -345,8 +345,11 @@ class RexNodeToExpressionConverter(
         SqlTimestamp.fromEpochMillis(millisecond, 
nanoOfMillisecond).toLocalDateTime
 
       case TIMESTAMP_WITH_LOCAL_TIME_ZONE =>
-        val v = literal.getValueAs(classOf[java.lang.Long])
-        unixTimestampToLocalDateTime(v).atZone(timeZone.toZoneId).toInstant
+        val v = literal.getValueAs(classOf[TimestampString])
+        val millisecond = unixTimestampToLocalDateTime(v.getMillisSinceEpoch)
+          .atZone(timeZone.toZoneId).toInstant.toEpochMilli
+        val nanoOfMillisecond = 
SqlDateTimeUtils.getNanoOfMillisSinceEpoch(v.toString)
 
 Review comment:
   refactor by introducing TimestampStringUtils to convert between 
LocalDateTime and TimestampString

----------------------------------------------------------------
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

Reply via email to