-
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
Implement current_time
Function
#3982
Comments
This sounds good start to me, could you please assign it to me or some extra advises? |
@alamb postgresql's current_time returns TIMETZ willy=# select pg_typeof(current_time);
pg_typeof
---------------------
time with time zone
(1 row) what should we return here? |
@waitingkuo I was imagining it would return a https://docs.rs/arrow/latest/arrow/array/type.Time64NanosecondArray.html But I have not thought as deeply as you about the timezone implications, so if you have a different suggestion I would love to hear it.
Hi @naosense -- thanks and done! |
@alamb i have no idea for timetz in arrow-rs for now as i think we could either
in the long run, we might consider make these function names explicitly like what was discussed in |
This would be my suggestion |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
As we add more full featured date/time support for DataFusion users need to be able to use the current time to calculate things like "all data in the last 5 hours"
Describe the solution you'd like
Support the
current_time
postgres function https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-CURRENTNote I think we should avoid the
current_time(precision)
variant initially -- we can implement it as a follow on PR.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
This is a feature request we got from an early (internal) user of InfluxDB IOx
I believe this is a good first issue as you can follow the existing implementation of
now()
query_execution_start_time
fieldIt would be a good exercise to add a new build in scalar function, physical planing support, and then tests
Note this the same ticket exists for the
current_date
function #3981The text was updated successfully, but these errors were encountered: