-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
move type coercion
for case when expr
#3676
Conversation
99efd9e
to
f3c2148
Compare
f3c2148
to
41bb500
Compare
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.
I think the code looks good to me -- Adding some tests in datafusion/optimizer/src/type_coercion.rs that demonstrate the coercion working (especially with/without a else
clause) would make this PR even better
Thanks @liukun4515
None => Err(DataFusionError::Internal(format!( | ||
"Failed to coerce types {:?} and {:?} in CASE WHEN expression", | ||
then_types, else_type | ||
))), |
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.
None => Err(DataFusionError::Internal(format!( | |
"Failed to coerce types {:?} and {:?} in CASE WHEN expression", | |
then_types, else_type | |
))), | |
None => Err(DataFusionError::Plan(format!( | |
"Failed to coerce then ({:?}) and else ({:?}) to common types in CASE WHEN expression", | |
then_types, else_type | |
))), |
"| 3 |", | ||
"+------------------------------------------------+", | ||
"+----------------------------------------------+", | ||
"| CASE WHEN a.b IS NULL THEN NULL ELSE a.b END |", |
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.
this looks like an improvement but I don't understand the change
Ticket for CI coverage failure: #3678 |
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
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.
LGTM
Benchmark runs are scheduled for baseline = df9c418 and contender = 0111732. 0111732 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3673
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?