Commit abf8f61
authored
fix[physical-expr-adapter]: support casting structs nested inside complex types (apache#20907)
Previously, DefaultPhysicalExprAdapterRewriter.create_cast_column_expr
would only allow struct evolution for top-level structs. However, it is
valid to have structs that are nested inside other complex types (e.g.
Dictionary<_, Struct>, List<Struct>). These cases would previously
return an error although they were valid.
This commit handles Structs that are arbitrarily nested within certain
complex types (Lists, ListViews, and Dicts). Other complex types can be
supported in the future, but I think this is good enough for now.
## Which issue does this PR close?
- Closes apache#20906
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
Struct evolution is supported, this PR fixes an edge case where struct
evolution is not supported when structs are nested inside other complex
types.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
## Are these changes tested?
Yes, I initially wrote parametrized tests, but I think that's probably
overkill.
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
Queries that would previously error, now complete successfully.
Signed-off-by: Alfonso Subiotto Marques <alfonso.subiotto@polarsignals.com>1 parent 6796053 commit abf8f61
File tree
6 files changed
+569
-131
lines changed- datafusion
- common/src
- scalar
- expr-common/src
- physical-expr-adapter/src
- physical-expr/src/expressions
6 files changed
+569
-131
lines changed
0 commit comments