-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flatten case when branch result type in PlanTyper #1368
Conversation
Conformance comparison report
Number passing in both: 5384 Number failing in both: 434 Number passing in Base (5e9cd19) but now fail: 0 Number failing in Base (5e9cd19) but now pass: 0 |
@@ -796,7 +796,7 @@ internal class PlanTyper( | |||
} | |||
|
|||
// Replace the result's type | |||
val type = AnyOfType(ref.type.allTypes.filterIsInstance<StructType>().toSet()) | |||
val type = AnyOfType(ref.type.allTypes.filterIsInstance<StructType>().toSet()).flatten() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the other branch (L767-785), there is a .flatten()
call on L782, but there is no .flatten()
call within this branch.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1368 +/- ##
============================================
- Coverage 80.76% 72.15% -8.61%
- Complexity 2064 2095 +31
============================================
Files 191 221 +30
Lines 13987 15984 +1997
Branches 2651 2896 +245
============================================
+ Hits 11297 11534 +237
- Misses 1903 3641 +1738
- Partials 787 809 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
Typing of a
CASE WHEN
branch does not flatten the type in certain circumstances. Noticed this when I calledSELECT <table>.<struct>.* FROM <table>
and the an argument of theTUPLEUNION
was anAnyOfType
containing a singleSTRUCT
.Other Information
Updated Unreleased Section in CHANGELOG: [Yes]
Any backward-incompatible changes? [NO]
Any new external dependencies? [NO]
Do your changes comply with the Contributing Guidelines
and Code Style Guidelines? [YES]
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.