waitingkuo commented on code in PR #4385:
URL: https://github.com/apache/arrow-datafusion/pull/4385#discussion_r1040652175


##########
datafusion/core/tests/sql/expr.rs:
##########
@@ -1285,12 +1285,36 @@ async fn test_extract_date_part() -> Result<()> {
         "12"
     );
     test_expression!(
-        "EXTRACT(second FROM to_timestamp('2020-09-08T12:00:12+00:00'))",
-        "12"
+        "EXTRACT(second FROM 
to_timestamp('2020-09-08T12:00:12.12345678+00:00'))",
+        "12.12345678"
     );
     test_expression!(
-        "date_part('second', to_timestamp('2020-09-08T12:00:12+00:00'))",
-        "12"
+        "EXTRACT(millisecond FROM 
to_timestamp('2020-09-08T12:00:12.12345678+00:00'))",
+        "12123.45678"
+    );
+    test_expression!(
+        "EXTRACT(microsecond FROM 
to_timestamp('2020-09-08T12:00:12.12345678+00:00'))",
+        "12123456.78"
+    );
+    // test_expression!(
+    //     "EXTRACT(nanosecond FROM 
to_timestamp('2020-09-08T12:00:12.12345678+00:00'))",
+    //     "1212345678"
+    // );

Review Comment:
   i suggest that uncomment this test case and expect the error
   e.g. 
https://github.com/apache/arrow-datafusion/blob/740a4fa2c6ba4b85875a433bb86e5b00435a5969/datafusion/core/tests/sql/timestamp.rs#L1071-L1074
   



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