You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/12/12 08:19:45 UTC

[GitHub] [calcite] tanclary commented on a diff in pull request #3000: [CALCITE-5423] Implement TIMESTAMP_DIFF function (compatible with BigQuery)

tanclary commented on code in PR #3000:
URL: https://github.com/apache/calcite/pull/3000#discussion_r1045517177


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -7534,6 +7534,10 @@ private static void checkArrayConcatAggFuncFails(SqlOperatorFixture t) {
     f.checkScalar("timestampdiff(\"month4\", date '2016-02-24', "
             + "date '2016-02-23')",
         "0", "INTEGER NOT NULL");
+    f.withLibrary(SqlLibrary.BIG_QUERY).setFor(SqlLibraryOperators.TIMESTAMP_DIFF)
+        .checkScalar("timestamp_diff(timestamp '2008-12-25 15:30:00', "
+            + "timestamp '2008-12-25 16:30:00', \"minute15\")",
+            "4", "INTEGER NOT NULL");

Review Comment:
   My understanding was that since timestamp_diff just uses a timeunit as opposed to an interval like timestamp_add, it should be able to support custom timeframes. Should I put this test in the timestamp_diff-specific test instead?



-- 
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: commits-unsubscribe@calcite.apache.org

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