Skip to content

to_timestamp(double) gives different results depending on scalar/vectorized call context #16678

@findepi

Description

@findepi

Describe the bug

We have this in SLT tests

query PPP
SELECT to_timestamp(1.1) as c1, ...
----
1970-01-01T00:00:01.100 ...

and indeed it works in CLI

> SELECT to_timestamp(1.1);
+----------------------------+
| to_timestamp(Float64(1.1)) |
+----------------------------+
| 1970-01-01T00:00:01.100    |
+----------------------------+

unless the value is not result of constant folding

> SELECT to_timestamp(x) FROM (VALUES (1.1), (NULL)) t(x);
+-------------------------------+
| to_timestamp(t.x)             |
+-------------------------------+
| 1970-01-01T00:00:00.000000001 |
| NULL                          |
+-------------------------------+

To Reproduce

No response

Expected behavior

Same result

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions