move type coercion for case when expr#3676
Conversation
99efd9e to
f3c2148
Compare
f3c2148 to
41bb500
Compare
alamb
left a comment
There was a problem hiding this comment.
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.
| 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.
this looks like an improvement but I don't understand the change
|
Ticket for CI coverage failure: #3678 |
Co-authored-by: Andrew Lamb <[email protected]>
|
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?