superdiaodiao commented on code in PR #24988:
URL: https://github.com/apache/flink/pull/24988#discussion_r1729656998


##########
docs/data/sql_functions.yml:
##########
@@ -653,6 +653,16 @@ temporal:
         CURRENT_WATERMARK(ts) IS NULL
         OR ts > CURRENT_WATERMARK(ts)
       ```
+  - sql: DATE_ADD(startDate, numDays)
+    table: startDate.dateAdd(numDays)
+    description: |
+      Returns the date numDays after startDate.
+      If numDays is negative, -numDays are subtracted from startDate.
+      
+      `startDate <DATE | TIMESTAMP_WITHOUT_TIME_ZONE | 
TIMESTAMP_WITH_LOCAL_TIME_ZONE | CHAR | VARCHAR>, numDays <TINYINT | SMALLINT | 
INTEGER | BIGINT>`
+      
+      Returns a `DATE`, `NULL` if any of the arguments are `NULL` or result 
overflows or date string invalid.

Review Comment:
   ```suggestion
         Returns a `DATE`, `NULL` if any of the arguments is `NULL` or result 
overflows or date string is invalid.
   ```



##########
flink-python/pyflink/table/expression.py:
##########
@@ -1555,6 +1555,18 @@ def ceil(self, time_interval_unit: TimeIntervalUnit = 
None) -> 'Expression':
             return _binary_op("ceil")(
                 self, time_interval_unit._to_j_time_interval_unit())
 
+    def date_add(self, num_days) -> 'Expression':
+        """
+        Adds num_days days to start_date.
+        If num_days is negative, -num_days are subtracted from start_date.
+
+        null if any of the arguments are null or result overflows or date 
string invalid.

Review Comment:
   ```suggestion
           null if any of the arguments is null or result overflows or date 
string is invalid.
   ```



##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/BaseExpressions.java:
##########
@@ -1532,6 +1533,19 @@ public OutType ceil(TimeIntervalUnit timeIntervalUnit) {
                 unresolvedCall(CEIL, toExpr(), 
valueLiteral(timeIntervalUnit)));
     }
 
+    /**
+     * Adds {@code numDays} days to {@code startDate}.<br>
+     * If {@code numDays} is negative, {@code -numDays} are subtracted from 
{@code startDate}.<br>
+     * null if any of the arguments are null or result overflows or date 
string invalid.

Review Comment:
   ```suggestion
        * null if any of the arguments is null or result overflows or date 
string is invalid.
   ```



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