asolimando commented on code in PR #2995:
URL: https://github.com/apache/calcite/pull/2995#discussion_r1042448897


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -2172,7 +2163,11 @@ public static String timeWithLocalTimeZoneToString(int 
v, TimeZone timeZone) {
   /** Converts the internal representation of a SQL TIMESTAMP (long) to the 
Java
    * type used for UDF parameters ({@link java.sql.Timestamp}). */
   public static java.sql.Timestamp internalToTimestamp(long v) {
-    return new java.sql.Timestamp(v - LOCAL_TZ.getOffset(v));
+    final LocalDateTime dateTime = LocalDateTime.ofEpochSecond(
+        v / DateTimeUtils.MILLIS_PER_SECOND,
+        (int) (v % DateTimeUtils.MILLIS_PER_SECOND * 1000000),
+        ZoneOffset.UTC);

Review Comment:
   Thanks @freastro, I think it's great now, good job!



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to