raminqaf commented on code in PR #27757:
URL: https://github.com/apache/flink/pull/27757#discussion_r2954356497


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ValueLiteralExpression.java:
##########
@@ -429,4 +428,34 @@ private static String stringifyValue(Object value) {
         }
         return StringUtils.arrayAwareToString(value);
     }
+
+    /**
+     * Serializes a TIMESTAMP_LTZ literal as a SQL string. Uses the numeric 
variant {@code
+     * TO_TIMESTAMP_LTZ(epoch, precision)} for readability when the value fits 
in a long, and falls
+     * back to the string variant for large values that would overflow.
+     */
+    private static String serializeTimestampLtz(Instant instant, int 
precision) {
+        if (canRepresentAsLong(instant, precision)) {
+            long epochValue = DateTimeUtils.toEpochValue(instant, precision);
+            return String.format("TO_TIMESTAMP_LTZ(%d, %d)", epochValue, 
precision);

Review Comment:
   Addressed 



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