jonahgao opened a new issue, #9440:
URL: https://github.com/apache/arrow-datafusion/issues/9440
### Describe the bug
When performing a SQL `CAST` operation and the target is an ARRAY type.
### To Reproduce
Run `select [1,2,3]::int[]` in CLI.
```sh
DataFusion CLI v36.0.0
❯ select [1,2,3]::int[];
Optimizer rule 'simplify_expressions' failed
caused by
simplify_expressions
caused by
Internal error: Failed due to a difference in schemas, original schema:
DFSchema { fields: [DFField { qualifier: None, field: Field { name:
"make_array(Int64(1),Int64(2),Int64(3))", data_type: List(Field { name: "item",
data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} }), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } }],
metadata: {}, functional_dependencies: FunctionalDependencies { deps: [] } },
new schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name:
"make_array(Int64(1),Int64(2),Int64(3))", data_type: List(Field { name:
"field", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} } }], metadata: {}, functional_dependencies: FunctionalDependencies { deps:
[] } }.
This was likely caused by a bug in DataFusion's code and we would welcome
that you file an bug report in our issue tracker
❯ select cast([1,2,3] as int[]);
Optimizer rule 'simplify_expressions' failed
caused by
simplify_expressions
caused by
Internal error: Failed due to a difference in schemas, original schema:
DFSchema { fields: [DFField { qualifier: None, field: Field { name:
"make_array(Int64(1),Int64(2),Int64(3))", data_type: List(Field { name: "item",
data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} }), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } }],
metadata: {}, functional_dependencies: FunctionalDependencies { deps: [] } },
new schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name:
"make_array(Int64(1),Int64(2),Int64(3))", data_type: List(Field { name:
"field", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} } }], metadata: {}, functional_dependencies: FunctionalDependencies { deps:
[] } }.
This was likely caused by a bug in DataFusion's code and we would welcome
that you file an bug report in our issue tracker
```
### Expected behavior
These casts should be successful.
### Additional context
_No response_
--
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]