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


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -11920,6 +11957,24 @@ void testTimestampDiff(boolean coercionEnabled) {
     f.checkFails("datediff(^\"MONTH\"^, '2019-09-14',  '2019-09-15')",
         "(?s)Column 'MONTH' not found in any table",
         false);
+
+    final SqlOperatorFixture f0 = f.withLibrary(SqlLibrary.BIG_QUERY);
+    f0.checkScalar("date_diff(DATE '2010-07-07', DATE '2008-12-25', DAY)",
+        "559",
+        "INTEGER NOT NULL");
+    f0.checkScalar("date_diff(DATE '2010-07-14', DATE '2010-07-07', WEEK)",
+        "1",
+        "INTEGER NOT NULL");
+    f0.checkScalar("date_diff(DATE '2011-12-14', DATE '2011-07-14', MONTH)",
+        "5",
+        "INTEGER NOT NULL");
+    f0.checkScalar("date_diff(DATE '2011-10-14', DATE '2011-07-14', QUARTER)",
+        "1",
+        "INTEGER NOT NULL");
+    f0.checkScalar("date_diff(DATE '2021-07-14', DATE '2011-07-14', YEAR)",
+        "10",
+        "INTEGER NOT NULL");

Review Comment:
   But this exception is not included in checkfail.
   ![2023-12-20 
21-42-21屏幕截图](https://github.com/apache/calcite/assets/77189278/672e0f70-525b-4a7a-a6da-5f8485a325b0)
   



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