Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-38030][SQL] Canonicalization should not remove nullability of …
…AttributeReference dataType ### What changes were proposed in this pull request? Canonicalization of AttributeReference should not remove nullability information of its dataType. ### Why are the changes needed? SPARK-38030 lists an issue where canonicalization of cast resulted in an unresolved expression, thus causing query failure. The issue was that the child AttributeReference's dataType was converted to nullable during canonicalization and hence the Cast's `checkInputDataTypes` fails. Although the exact repro listed in SPARK-38030 no longer works in master due to an unrelated change (details in the JIRA), some other codepaths which depend on canonicalized representations can trigger the same issue. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added unit test to ensure that canonicalization preserves nullability of AttributeReference and does not result in an unresolved cast Closes #35332 from shardulm94/SPARK-38030. Authored-by: Shardul Mahadik <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information