-
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
Support of timestamps and steps of less than a day for generate_series
#11822
Comments
I opened #11823 for the bug as well |
Thank you @Abdullahsab3 |
I'm curious what the smallest interval that these udf's should support? Seconds? Millis? Nanos? Should calls like the following be supported
or should intervals less than a day still be disallowed if arg[0] is not of a timestamp type? |
Sky is the limit :-) I think postgres supports all kinds of intervals (except nanos since those are not supported by postgresql), but they handle |
I thought about that as well though my main concern with that would that it would be an api change for these UDF's since the output type would change unexpectedly between releases. It would make the implementation easier though |
take |
So I've implemented this in a local branch with all dates being converted to timestamps which may/will break any existing query that expects a date32 out but gets a timestamp instead. I'm not terribly comfortable with that so I think I may change the proposed implementation as follows:
|
This makes sense to me @Omega359 -- thank you .
I think it makes sense to start with getting the basics down, and maybe documenting that there are potential inconsistencies in certain cases. Then that behavior can be more easily improved by anyone who needs it |
#12400 -- thre is a PR up for this feature |
Is your feature request related to a problem or challenge?
I would like to have support of time generation using time ranges and with steps that are less than 1 day (e.g. an hour, custom range of x seconds, etc). The current
generate_series
only supports the following:This is built in postgresDB, so it might be a good inspiration source for how it can be implemented in Datafusion.
Note: There is probably a bug in the current
generate_series
implementation. When specifying a step less than an interval of 1 day, Datafusion hangs indefinitely. Link to bug report #11823Describe the solution you'd like
Example:
select generate_series('2023-01-01 10:00:00'::timestamp, '2023-01-31 23:59:00'::timestamp, '1 hour'::interval) as date_time;
Describe alternatives you've considered
No response
Additional context
This feature is really crucial for time series handling. influxDB is built on top of Datafusion and needs to have this as well :)
The text was updated successfully, but these errors were encountered: