Skip to content

are there a function works as generate_series()of postgresql in datafusion? #9315

Answered by jonahgao
l1t1 asked this question in Q&A
Discussion options

You must be logged in to vote

There is an array function with the same name, but it is not a table function like in PostgreSQL.

DataFusion CLI v36.0.0
❯ select generate_series(1,10);
+-----------------------------+
| range(Int64(1),Int64(10))   |
+-----------------------------+
| [1, 2, 3, 4, 5, 6, 7, 8, 9] |
+-----------------------------+
1 row in set. Query took 0.011 seconds.

❯ select * from generate_series(1,10);
Error during planning: table function 'generate_series' not found

You can implement it as a user-defined table function and register it in DataFusion. Here's an example.

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by l1t1
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@SteveLauC
Comment options

@SteveLauC
Comment options

Comment options

You must be logged in to vote
1 reply
@jonahgao
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants