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 2019/07/29 02:44:58 UTC

[GitHub] [calcite] chunweilei commented on a change in pull request #1331: [CALCITE-2496] Return 0 in case of extract(milli/micro/nanosecond from Date)

chunweilei commented on a change in pull request #1331: [CALCITE-2496] Return 0 in case of extract(milli/micro/nanosecond from Date)
URL: https://github.com/apache/calcite/pull/1331#discussion_r308039531
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
 ##########
 @@ -6928,6 +6938,21 @@ private void checkNullOperand(SqlTester tester, String op) {
         "0",
         "BIGINT NOT NULL");
 
+    tester.checkScalar(
+        "extract(millisecond from date '2008-2-23')",
+        "0",
+        "BIGINT NOT NULL");
+
+    tester.checkScalar(
+        "extract(microsecond from date '2008-2-23')",
+        "0",
+        "BIGINT NOT NULL");
+
+    tester.checkScalar(
+        "extract(nanosecond from date '2008-2-23')",
+        "0",
+        "BIGINT NOT NULL");
+
 
 Review comment:
   There is already a test case for extracting millisecond/microsecond from a date before epoch. See https://github.com/apache/calcite/pull/1331/files#diff-25687b6ff3e28fb79b62ba5050883d45R7290

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services