Skip to content

generate_series UDTF only supports integers #14209

@Abdullahsab3

Description

@Abdullahsab3

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:

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions