-
thanks |
Beta Was this translation helpful? Give feedback.
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 found You can implement it as a user-defined table function and register it in DataFusion. Here's an example. |
Beta Was this translation helpful? Give feedback.
-
could modify the results of generate_series to including the upper bound parameter? |
Beta Was this translation helpful? Give feedback.
-
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] │
└─────────────┘ |
Beta Was this translation helpful? Give feedback.
-
please also add generate_series documents to https://arrow.apache.org/datafusion/user-guide/sql/scalar_functions.html |
Beta Was this translation helpful? Give feedback.
-
the unnest() function is also needed D select unnest(range(1,3));
┌─────────────────────┐
│ unnest(range(1, 3)) │
│ int64 │
├─────────────────────┤
│ 1 │
│ 2 │
└─────────────────────┘ |
Beta Was this translation helpful? Give feedback.
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.