sdf-jkl commented on code in PR #27316:
URL: https://github.com/apache/datafusion/pull/27316#discussion_r4546905602
##########
datafusion/sqllogictest/test_files/datetime/timestamps.slt:
##########
@@ -749,6 +749,85 @@ select date '1994-01-01' - interval '1' day as date;
----
1993-12-31
+# TIME precision selects the Arrow unit; the default remains nanoseconds.
+query TTTTT
+SELECT arrow_typeof(CAST(NULL AS TIME)) AS t,
+ arrow_typeof(CAST(NULL AS TIME(0))) AS s,
+ arrow_typeof(CAST(NULL AS TIME(3))) AS ms,
+ arrow_typeof(CAST(NULL AS TIME(6))) AS us,
+ arrow_typeof(CAST(NULL AS TIME(9))) AS ns;
+----
+Time64(ns) Time32(s) Time32(ms) Time64(µs) Time64(ns)
+
+# String casts truncate fractional seconds to the requested precision.
+query DDDD
+SELECT CAST('12:34:56.123456789' AS TIME(0)) AS s,
+ CAST('12:34:56.123456789' AS TIME(3)) AS ms,
+ CAST('12:34:56.123456789' AS TIME(6)) AS us,
+ CAST('12:34:56.123456789' AS TIME(9)) AS ns;
+----
+12:34:56 12:34:56.123 12:34:56.123456 12:34:56.123456789
+
+# Column declarations use the same mapping, including WITHOUT TIME ZONE.
+statement ok
+CREATE TABLE times (
Review Comment:
Thanks, fixed here --
https://github.com/apache/datafusion/pull/27316/changes/4d99f9813606914dd0cb3067fe824c2f20ea20cd
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]