suggest add table function `generate_series` and change the results of current version
Is your feature request related to a problem or challenge?
as https://github.com/apache/arrow-datafusion/discussions/9315 mentioned, generate_series is alias of range, it's result does not include the upper bound. it results the problem of Portability from other DBMS.
Describe the solution you'd like
the result of generate_series is same as that of postgresql, the range() funciton keeps the current result
select generate_series(1,3);
generate_series
-----------------
1
2
3
select * from generate_series(1,3);
generate_series
-----------------
1
2
3
Describe alternatives you've considered
No response
Additional context
No response
databend's numbers function + 1 is similar with generate_series
ctx.sql("select number+1 from numbers(3)")
┌──────────────┐
│ (number + 1) │
│ UInt64 │
├──────────────┤
│ 1 │
│ 2 │
│ 3 │
└──────────────┘
I'm just wondering what is the purpose of datafusion to design in such a way. If this feature is needed, I can do this one.
Here is the duckdb syntax: https://duckdb.org/docs/sql/functions/nested.html#range-functions
It looks to me like generate_series and range can be both scalar functions (return list) or table functions (return a table)
I think we should follow postgres or duckdb's syntax
take