You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/09/12 09:24:46 UTC

[GitHub] [flink] snuyanzin commented on a diff in pull request #20323: [FLINK-26944][Table SQL/API] Add ADD_MONTHS supported in SQL and Table API

snuyanzin commented on code in PR #20323:
URL: https://github.com/apache/flink/pull/20323#discussion_r968185297


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java:
##########
@@ -1646,6 +1646,13 @@ public static int addMonths(int date, int m) {
         return ymdToUnixDate(y0, m0, d0);
     }
 
+    /** Adds a given number of months to a dateStr, represented as the date since the epoch. */
+    public static String addMonths(String dateStr, int m) {
+        int date1 = DateTimeUtils.parseDate(dateStr, DATE_FORMAT_STRING);

Review Comment:
   Do we really need to have `DateTimeUtils.parseDate` if we are already in `DateTimeUtils` class?



-- 
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-unsubscribe@flink.apache.org

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