davidzollo commented on code in PR #9334:
URL: https://github.com/apache/seatunnel/pull/9334#discussion_r2146966405


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/functions/StringFunction.java:
##########
@@ -697,4 +715,28 @@ public static String translate(List<Object> args) {
         }
         return builder == null ? original : builder.toString();
     }
+
+    private static String formatDate(Object obj) {
+        String s = null;
+        // Handle Date and Timestamp data types.
+        if (obj instanceof Date) {
+            Date d = (Date) obj;
+            SimpleDateFormat dateFormat = new 
SimpleDateFormat(DATE_TIME_FORMAT_PATTERN);
+            s = dateFormat.format(d);
+        } else if (obj instanceof LocalDateTime) {
+            LocalDateTime d = (LocalDateTime) obj;
+            DateTimeFormatter dateTimeFormatter =
+                    DateTimeFormatter.ofPattern(DATE_TIME_FORMAT_PATTERN);
+            s = dateTimeFormatter.format(d);
+        } else if (obj instanceof LocalDate) {
+            LocalDate d = (LocalDate) obj;
+            DateTimeFormatter dateTimeFormatter = 
DateTimeFormatter.ofPattern(DATE_FORMAT_PATTERN);
+            s = dateTimeFormatter.format(d);
+        } else if (obj instanceof LocalTime) {
+            LocalTime d = (LocalTime) obj;
+            DateTimeFormatter dateTimeFormatter = 
DateTimeFormatter.ofPattern(TIME_FORMAT_PATTERN);
+            s = dateTimeFormatter.format(d);

Review Comment:
   @sulthan309  Please consider the AI's suggestion



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