Skip to content

to_timestamp for negative values gives wrong result #7802

@comphead

Description

@comphead

Describe the bug

In Datafusion to_timestamp builtin scalar function gives wrong result for negative values


❯ select to_timestamp(-62125747200);
+-----------------------------------+
| to_timestamp(Int64(-62125747200)) |
+-----------------------------------+
| 1969-12-31T23:58:57.874252800     |
+-----------------------------------+
1 row in set. Query took 0.035 seconds.

PG gives correct result

0001-04-25T00:00:00.000Z

To Reproduce

Run

❯ select to_timestamp(-62125747200);

Expected behavior

Query results should match

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions