chovy-3012 commented on code in PR #5462:
URL: https://github.com/apache/seatunnel/pull/5462#discussion_r1325455453


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/functions/DateTimeFunction.java:
##########
@@ -541,4 +543,16 @@ public static Integer year(List<Object> args) {
         LocalDate localDate = convertToLocalDate(datetime);
         return localDate.getYear();
     }
+
+    public static String fromUnixTime(List<Object> args) {
+        Long unixTime = (Long) args.get(0);
+        if (unixTime == null) {
+            return null;
+        }
+        String format = (String) args.get(1);
+        DateTimeFormatter df = DateTimeFormatter.ofPattern(format);
+        LocalDateTime datetime =
+                
Instant.ofEpochSecond(unixTime).atZone(ZoneId.systemDefault()).toLocalDateTime();
+        return df.format(datetime);
+    }

Review Comment:
   I've already add doc about this function in sql-functions.md
   add `timezone` optional parameter in this function
   and  add `timezone` case in the unit test.



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