y0908105023 commented on code in PR #20846:
URL: https://github.com/apache/flink/pull/20846#discussion_r979900275


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java:
##########
@@ -1400,6 +1401,25 @@ public static String formatUnixTimestamp(long unixtime, 
TimeZone tz) {
         return formatUnixTimestamp(unixtime, TIMESTAMP_FORMAT_STRING, tz);
     }
 
+    /** Add offset to string (like '1970-01-01') and return new date For 
String support. */
+    public static Integer dateAdd(BinaryStringData binaryStringData, int 
offset) {
+
+        if (binaryStringData == null) {
+            return null;
+        }
+        try {
+            int days = parseDate(binaryStringData.toString());
+            return days + offset;
+        } catch (NullPointerException e) {

Review Comment:
   i modify this, add execption log. just reference formatUnixTimestamp,if 
string args is not  legal format,log and return null.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to