You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2025/10/18 00:51:45 UTC

Re: [PR] test: `to_timestamp(double)` for vectorized input [datafusion]

Jefffrey commented on code in PR #18147:
URL: https://github.com/apache/datafusion/pull/18147#discussion_r2441486966


##########
datafusion/sqllogictest/test_files/timestamps.slt:
##########
@@ -525,6 +525,29 @@ SELECT to_timestamp(123456789.123456789) as c1, cast(123456789.123456789 as time
 ----
 1973-11-29T21:33:09.123456784 1970-01-01T00:00:00.123456789 1970-01-01T00:00:00.123456789
 
+## to_timestamp float vectorized inputs
+query PPP
+SELECT
+  to_timestamp(x) as c1,
+  cast(x as timestamp) as c2,
+  x::timestamp as c3
+FROM (
+  VALUES
+    (1.1),
+    (-1.1),
+    (0.0),
+    (1.23456789),
+    (123456789.123456789),
+    (NULL)
+) t(x);
+----
+1970-01-01T00:00:01.100 1970-01-01T00:00:00.000000001 1970-01-01T00:00:00.000000001
+1969-12-31T23:59:58.900 1969-12-31T23:59:59.999999999 1969-12-31T23:59:59.999999999
+1970-01-01T00:00:00 1970-01-01T00:00:00 1970-01-01T00:00:00
+1970-01-01T00:00:01.234567890 1970-01-01T00:00:00.000000001 1970-01-01T00:00:00.000000001
+1973-11-29T21:33:09.123456784 1970-01-01T00:00:00.123456789 1970-01-01T00:00:00.123456789

Review Comment:
   Differences here because the cast will truncate the decimal points?



-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org