-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 for set returning functions (generate_series) #2169
Comments
generate_series is very very useful in practice. However, you can get quite Example: i11 I presume if you had a function that could return an arbitrary array Thanks On Thu, Jan 1, 2015 at 2:58 PM, Nick Porter notifications@github.com
|
so how can we generate series like for example 0,3,5,7......,99? EDIT: I did with small arrangement: |
This issue has been automatically marked as stale because it has not had any activity in the last 2 years. If you feel that this issue is important, just comment and the stale tag will be removed; otherwise it will be closed in 7 days. This is an attempt to ensure that our open issues remain valuable and relevant so that we can keep track of what needs to be done and prioritize the right things. |
Shorter version of "generate series like for example 0,3,5,7......,99?":
|
Set returning functions like
generate_series
are incredibly useful in Postgres. Would be neat to have them in presto!Postgres Set Returning functions:
http://www.postgresql.org/docs/9.4/static/functions-srf.html
Consider the following use case:
I have a table of orders. An order has a timestamp and a total. I want to make a report of daily order totals. Also, let's say the store is closed on Mondays (i.e. there are no orders made on Mondays).
In order to get a continuous time series of totals, with all Mondays totalling to 0, I would generate a series of days, left join it with my orders table on timestamp (date trunc'd to day), and do
coalesce(total, 0)
.The text was updated successfully, but these errors were encountered: