Replies: 5 comments 3 replies
|
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 foundYou can implement it as a user-defined table function and register it in DataFusion. Here's an example. |
0 replies
Answer selected by
l1t1
|
could modify the results of generate_series to including the upper bound parameter? |
0 replies
|
range() excluding the upper bound D select generate_series(1,3);
┌───────────────────────┐
│ generate_series(1, 3) │
│ int64[] │
├───────────────────────┤
│ [1, 2, 3] │
└───────────────────────┘
D select range(1,3);
┌─────────────┐
│ range(1, 3) │
│ int64[] │
├─────────────┤
│ [1, 2] │
└─────────────┘ |
0 replies
|
please also add generate_series documents to https://arrow.apache.org/datafusion/user-guide/sql/scalar_functions.html |
2 replies
|
the unnest() function is also needed D select unnest(range(1,3));
┌─────────────────────┐
│ unnest(range(1, 3)) │
│ int64 │
├─────────────────────┤
│ 1 │
│ 2 │
└─────────────────────┘ |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is an array function with the same name, but it is not a table function like in PostgreSQL.
You can implement it as a user-defined table function and register it in DataFusion. Here's an example.