alamb opened a new issue, #13819:
URL: https://github.com/apache/datafusion/issues/13819
### Describe the bug
I expect that when I make a List / Array the element types remain the same
For example, a list of `Int32` makes List(Int32)
```sql
> select arrow_typeof([1, 2, 3]);
+------------------------------------------------------------------------------------------------------------------+
| arrow_typeof(make_array(Int64(1),Int64(2),Int64(3)))
|
+------------------------------------------------------------------------------------------------------------------+
| List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0,
dict_is_ordered: false, metadata: {} }) |
+------------------------------------------------------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.001 seconds.
```
However, creating a List of `FixedSizedList` creates a `List(List))` rather
than a `List(FixedSizedList)`
```sql
> select arrow_typeof([arrow_cast([1,2,3], 'FixedSizeList(3, Int64)')]);
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
arrow_typeof(make_array(arrow_cast(make_array(Int64(1),Int64(2),Int64(3)),Utf8("FixedSizeList(3,
Int64)"))))
|
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| List(Field { name: "item", data_type: List(Field { name: "item",
data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.001 seconds.
```
### To Reproduce
This creates a FixedSizeList
```sql
arrow_cast([1,2,3], 'FixedSizeList(3, Int64)')
```
You can see that here:
```sql
> select arrow_typeof(arrow_cast([1,2,3], 'FixedSizeList(3, Int64)'));
+------------------------------------------------------------------------------------------------------------------------------+
|
arrow_typeof(arrow_cast(make_array(Int64(1),Int64(2),Int64(3)),Utf8("FixedSizeList(3,
Int64)"))) |
+------------------------------------------------------------------------------------------------------------------------------+
| FixedSizeList(Field { name: "item", data_type: Int64, nullable: true,
dict_id: 0, dict_is_ordered: false, metadata: {} }, 3) |
+------------------------------------------------------------------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.001 seconds.
```
I expect that by wrapping it with `[]` it becomes a List of FixedSizedList,
but it does not:
```sql
> select arrow_typeof([arrow_cast([1,2,3], 'FixedSizeList(3, Int64)')]);
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
arrow_typeof(make_array(arrow_cast(make_array(Int64(1),Int64(2),Int64(3)),Utf8("FixedSizeList(3,
Int64)"))))
|
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| List(Field { name: "item", data_type: List(Field { name: "item",
data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.001 seconds.
```
### Expected behavior
I expect the output of this to be
```sql
> select arrow_typeof([arrow_cast([1,2,3], 'FixedSizeList(3, Int64)')]);
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
arrow_typeof(make_array(arrow_cast(make_array(Int64(1),Int64(2),Int64(3)),Utf8("FixedSizeList(3,
Int64)"))))
|
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| List(Field { name: "item", data_type: FixedSizeList(Field { name: "item",
data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} }, 3), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.001 seconds.
```
### Additional context
Follow on from discussion in
- https://github.com/apache/datafusion/pull/13756
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]