Skip to content

to_timestamp timeunit to be consistent with postgresql's #2979

@waitingkuo

Description

@waitingkuo

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Current to_timestamp assume the input number is nanoseconds from 1970

select to_timestamp(10);
+-------------------------------+
| totimestamp(Int64(10))        |
+-------------------------------+
| 1970-01-01 00:00:00.000000010 |
+-------------------------------+
1 row in set. Query took 0.000 seconds.

while postgresql's is to assume the number is seonds from 1970

willy=# select to_timestamp(10) at time zone 'utc';
      timezone       
---------------------
 1970-01-01 00:00:10
(1 row)

Should we align with postgrseql's?

Describe the solution you'd like

  1. rename the original to_timestamp as to_timestamp_nanoseconds
  2. we do have a to_timestamp_seconds for now. we could either rename it to to_timestamp or make a new to_timestamp as to_timestamp_seconds's alias

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions