Skip to content
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

generate_series UDTF only supports integers #14209

Open
Abdullahsab3 opened this issue Jan 20, 2025 · 0 comments
Open

generate_series UDTF only supports integers #14209

Abdullahsab3 opened this issue Jan 20, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@Abdullahsab3
Copy link
Contributor

Abdullahsab3 commented Jan 20, 2025

Is your feature request related to a problem or challenge?

The newly implemented generate_series UDTF seems to only supports integers. Timestamps don't seem supported:

> select * from generate_series(now() - interval '1 year', now(), interval '1 month');
Error during planning: First argument must be an integer literal
> select * from unnest(generate_series(now() - interval '1 year', now(), interval '1 month'));
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| UNNEST(generate_series(now() - IntervalMonthDayNano("IntervalMonthDayNano { months: 12, days: 0, nanoseconds: 0 }"),now(),IntervalMonthDayNano("IntervalMonthDayNano { months: 1, days: 0, nanoseconds: 0 }"))) |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2024-01-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-02-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-03-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-04-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-05-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-06-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-07-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-08-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-09-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-10-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-11-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2024-12-20T12:53:39.484276Z                                                                                                                                                                                     |
| 2025-01-20T12:53:39.484276Z                                                                                                                                                                                     |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
13 row(s) fetched. 
Elapsed 0.035 seconds.

It would be nice to have similarly supported types as to the array generate_series variant

Describe the solution you'd like

No response

Describe alternatives you've considered

epoch as input, but not the greatest idea since month steps for examples can differ depending on the month

Additional context

Related PRs:

@Abdullahsab3 Abdullahsab3 added the enhancement New feature or request label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant