-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed as not planned
Labels
bugSomething isn't workingSomething isn't working
Description
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 string to int;
Datafusion 35
DataFusion CLI v35.0.0
❯ explain select CAST('test' as int);
0 rows in set. Query took 0.016 seconds.Datafusion 36
DataFusion CLI v36.0.0
❯ explain select CAST('test' as int);
+---------------+------------------------------------------------------------+
| plan_type | plan |
+---------------+------------------------------------------------------------+
| logical_plan | Projection: CAST(Utf8("test") AS Int32) |
| | EmptyRelation |
| physical_plan | ProjectionExec: expr=[CAST(test AS Int32) as Utf8("test")] |
| | PlaceholderRowExec |
| | |
+---------------+------------------------------------------------------------+
2 rows in set. Query took 0.008 seconds.
### Expected behavior
in this example, i'd expect the cast to fail during planning as it did in 35
### Additional context
datafusion 35 will fail at 'simplify_expressions`
```sql
❯ select CAST('test' as int);
Optimizer rule 'simplify_expressions' failed
caused by
Arrow error: Cast error: Cannot cast string 'test' to value of Int32 typewhile 36 does not seem to specify anything about optimization, and seems to fail at execution instead of planning
❯ select CAST('test' as int);
Arrow error: Cast error: Cannot cast string 'test' to value of Int32 typeReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working