HIVE-24817: A "not in" clause returns incorrect data when there is co… #2012
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.
…ercion
When the query has a where clause that has an integer column checking against
being "not in" a decimal column, the decimal column is being changed to null,
causing incorrect results.
This is a sample query of a failure:
select count from my_tbl where int_col not in (355.8);
Since the int_col can never be 355.8, one would expect all the rows to be
returned, but it is changing the 355.8 into a null value causing no rows
to be returned.
The fix is that when the value is attempted to be interpreted and it fails,
the original type should be used rather than null.
What changes were proposed in this pull request?
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?