-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_timestamp timeunit to be consistent with postgresql's #2979
Comments
Hi @waitingkuo -- I think given the desire to make datafusion "A Declarative SQL query interface compatible with PostgreSQL" as described on https://arrow.apache.org/datafusion/specification/roadmap.html#datafusion compatible changing the current Here are the docs, in case anyone is interested |
i'm interested in this, please assign me, thanks~ |
@alamb after investigating more on postgresql's, i found that we have following differences: Differences
https://www.postgresql.org/docs/14/functions-datetime.html the input for
Summary & My proposal
Please leave your comments. I'll submit another issue for tracking all of these. |
Makes sense to me. 👍 cc @ovr @andygrove @seddonm1 @stuartcarnie (not sure if anyone else is interested in this discussion too)
There are a variety of open issues known about timestamp handling -- for example apache/arrow-rs#1936 apache/arrow-rs#1380 apache/arrow-rs#597 and others It would be great to figure out how best to support these and start fixing it up. |
@alamb should we consider in postgresql |
I think that can be a long term goal -- I suspect making that change will be hard / impossible without improving the timezone support in general across DataFusion |
I agree that sounds wise |
@alamb it seems like now is a great time to align time-related functions with PostgreSQL, as most of the fundamental work has already been completed. |
I agree -- it would be a good time. @waitingkuo would you be willing to make a new "date/time" epic and move all the unfinished stuff from #3148 to that new epic as a way to figure out what else is needed? |
@alamb |
Thanks @waitingkuo -- no rush! |
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
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
to_timestamp
as to_timestamp_nanosecondsto_timestamp
or make a newto_timestamp
asto_timestamp_seconds
's aliasThe text was updated successfully, but these errors were encountered: