Fix like scalar null#4832
Merged
tustvold merged 2 commits intoapache:masterfrom Sep 18, 2023
Merged
Conversation
alamb
approved these changes
Sep 18, 2023
| let l_len = l_v.map(|l| l.len()).unwrap_or(l.len()); | ||
| if r_s { | ||
| let scalar = match r_v { | ||
| Some(dict) => match dict.nulls().filter(|n| n.null_count() != 0) { |
Contributor
There was a problem hiding this comment.
is the bug the difference in the null check?
Contributor
Author
There was a problem hiding this comment.
The bug is for the non-dictionary case we didn't check nullability
| let b = Scalar::new(StringArray::new_null(1)); | ||
| let r = like(&a, &b).unwrap(); | ||
| assert_eq!(r.len(), 1); | ||
| assert_eq!(r.null_count(), 1); |
Contributor
There was a problem hiding this comment.
I suggest also verifing that r.is_valid(0) == false (though I realize this is technically redundant I think it might capture the intent of the test better)
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 #.
Rationale for this change
Found in apache/datafusion#7587
What changes are included in this PR?
Are there any user-facing changes?