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/25 17:10:29 UTC

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

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

 ##########
 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:
   Can you add a case extracting millisecond/microsecond from a date before epoch?

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