fix: remove type coercion of case expression in Expr::Schema#6614
Merged
alamb merged 2 commits intoapache:mainfrom Jun 9, 2023
Merged
fix: remove type coercion of case expression in Expr::Schema#6614alamb merged 2 commits intoapache:mainfrom
alamb merged 2 commits intoapache:mainfrom
Conversation
jackwener
commented
Jun 9, 2023
|
|
||
| # case_expr_with_null() | ||
| query I | ||
| query ? |
Member
Author
There was a problem hiding this comment.
It's strange. I can't understand it.
I exec sql to confirm type coercion is right
select arrow_typeof(case when b is null then null else b end) from (select a,b from (values (1,null),(2,3)) as t (a,b)) a;
+------------------------------------------------------------+
| arrow_typeof(CASE WHEN a.b IS NULL THEN NULL ELSE a.b END) |
+------------------------------------------------------------+
| Int64 |
| Int64 |
+------------------------------------------------------------+
jackwener
commented
Jun 9, 2023
Comment on lines
-979
to
-980
| let optimized = df.clone().into_optimized_plan().unwrap(); | ||
| assert_eq!(df.logical_plan().schema(), optimized.schema()); |
Member
Author
There was a problem hiding this comment.
we shouldn't check schema here.
Because analyzer will change schema
optimizer already contain schema checker, so we don't need assert_eq
Contributor
There was a problem hiding this comment.
I agree this check predated the existence of the analyzer
Member
Author
alamb
approved these changes
Jun 9, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
Makes sense to me -- thank you @jackwener
jayzhan211
pushed a commit
to jayzhan211/datafusion
that referenced
this pull request
Jun 12, 2023
…6614) * fix: remove type coercion of case expression in Expr::Schema * remove useless check, because we shouldn't
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #5821.
Rationale for this change
relate with #6613
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?