caicancai commented on code in PR #3911:
URL: https://github.com/apache/calcite/pull/3911#discussion_r1712855860


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -13519,6 +13519,32 @@ void testTimestampDiff(boolean coercionEnabled) {
     f.checkNull("date_add(CAST(NULL AS DATE), interval 5 day)");
   }
 
+  /** Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-6396";>[CALCITE-6396]
+   * Add ADD_MONTHS function (enabled in Spark library)</a>.
+   */
+  @Test void testAddMonths() {
+    final SqlOperatorFixture f0 = fixture()
+        .setFor(SqlLibraryOperators.ADD_MONTHS);
+    f0.checkFails("^add_months(date '2008-12-25', "
+            + "5)^",
+        "No match found for function signature "
+            + "ADD_MONTHS\\(<DATE>, <NUMERIC>\\)", false);
+    final SqlOperatorFixture f = f0.withLibrary(SqlLibrary.SPARK);
+    f.checkScalar("add_months(date '2016-02-22', 2)",

Review Comment:
   I read the official document of DataRisks, and the description in the 
document is only int type
   <img width="736" alt="image" 
src="https://github.com/user-attachments/assets/3a725fbb-459d-4734-adb8-d1437730fa4f";>
   https://docs.databricks.com/en/sql/language-manual/functions/add_months.html



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