You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
to_timestamp(double) gives different results depending on scalar/vectorized call context #16678
I have checked. There is no test for to_timestamp with vectorized input.
However, after looking closely at the #16639 and the test, I found that to_timestamp(double) and cast(double as timestamp) return different results.
datafusion/sqllogictest/test_files/timestamps.slt:504
query PPP
SELECT to_timestamp(1.1) as c1, cast(1.1 as timestamp) as c2, 1.1::timestamp as c3;
----
1970-01-01T00:00:01.100 1970-01-01T00:00:00.000000001 1970-01-01T00:00:00.000000001
Activity
dqkqd commentedon Oct 4, 2025
I cannot reproduce this in branch-50.
I think #16639 fixed this. I tried 4e32ab9.
Jefffrey commentedon Oct 17, 2025
Thanks for checking this @dqkqd
Do you think you can check if we have an SLT test for this? If not could raise a PR with the test case so we can close this issue
dqkqd commentedon Oct 17, 2025
@Jefffrey
I have checked. There is no test for
to_timestampwith vectorized input.However, after looking closely at the #16639 and the test, I found that
to_timestamp(double)andcast(double as timestamp)return different results.From https://github.com/apache/datafusion/pull/16639/files#r2213084931, I think what we want is to have
to_timestamp(double)return something like this:dqkqd commentedon Oct 17, 2025
take
dqkqd commentedon Oct 18, 2025
I was wrong, actually
to_timestampshould just cast as second instead of nanoseconds.I will just add the testcase, no other changes needed.
test: `to_timestamp(double)` for vectorized input (#18147)
Update fork (#12)
test: `to_timestamp(double)` for vectorized input (apache#18147)
test: `to_timestamp(double)` for vectorized input (apache#18147)