[fix] correct filter using expressions where each side returns nulls and/or mixed types#2758
Open
albertlockett wants to merge 2 commits intoopen-telemetry:mainfrom
Open
[fix] correct filter using expressions where each side returns nulls and/or mixed types#2758albertlockett wants to merge 2 commits intoopen-telemetry:mainfrom
albertlockett wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2758 +/- ##
==========================================
+ Coverage 88.13% 88.16% +0.02%
==========================================
Files 645 646 +1
Lines 248445 249458 +1013
==========================================
+ Hits 218956 219923 +967
- Misses 28965 29011 +46
Partials 524 524
🚀 New features to boost your workflow:
|
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.
Change Summary
Corrects the behaviour of filtering expressions where each side of a relative expression returns either nulls, types that are not equivalent and/or struct columns representing
AnyValues.For example, in a program like this:
In this case, we don't know at compile time what is the type of the left or right side of the
==expression, so we evaluate the expressions on either side and then attempt to compare the results. Before this change, we were effectively just naively using theeqcompute kernel (technically this would get called inside theBinaryExpr). This means that we'd produce incorrect results or errors in cases where:false, butnull == nullshould returntrue)AnyValue(such as log body, although attributes may also be coerced into a struct like this), we would also just return an error.This PR changes the implementation to use a special
comparekernel which handles all these cases. Effectively the logic it applies for each row would be:nulland the operator is==, returntruenulland the operator is!=returntruefalseThe
comparehandles comparing the appropriate values columns forAnyValues represented as struct columns. It also makes the determination if one side is effectively anullfor purpose of comparison -- it considers the row null when any of the following conditions are met:EmptyEmptytype column value is nullWhat issue does this PR close?
How are these changes tested?
Unit tests
Are there any user-facing changes?
No - this is basically just a bug fix for how OTAP query engine handles some filter expressions.