universalmind303 opened a new issue, #9951:
URL: https://github.com/apache/arrow-datafusion/issues/9951
### Describe the bug
Previously (df 35) if you did an invalid cast, it would fail during logical
planning. However, in datafusion 36, it does not fail during planning as
expected.
A way to visualize this is via `explain`. It'll show an empty result set if
the planning errored out.
### To Reproduce
A simple example of an invalid cast. casting an array of length 3 to a fixed
size list with length 2.
## Datafusion 35
```sql
DataFusion CLI v35.0.0
❯ explain select arrow_cast([1,2, 3], 'FixedSizeList(2, Float32)') as
embeddings;
0 rows in set. Query took 0.057 seconds.
```
## Datafusion 36
```sql
DataFusion CLI v36.0.0
❯ explain select arrow_cast([1,2, 3], 'FixedSizeList(2, Float32)') as
embeddings;
+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type | plan
|
+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan | Projection: CAST(List([1, 2, 3]) AS FixedSizeList(Field {
name: "item", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered:
false, metadata: {} }, 2)) AS embeddings |
| | EmptyRelation
|
| physical_plan | ProjectionExec: expr=[CAST([1, 2, 3] AS
FixedSizeList(Field { name: "item", data_type: Float32, nullable: true,
dict_id: 0, dict_is_ordered: false, metadata: {} }, 2)) as embeddings] |
| | PlaceholderRowExec
|
| |
|
+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
### Expected behavior
in this example, i'd expect the cast to fail during planning as it did in 35
### 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]