Add evalMv for MV predicate filtering (incl. REGEXP_LIKE)#17659
Open
xiangfu0 wants to merge 1 commit intoapache:masterfrom
Open
Add evalMv for MV predicate filtering (incl. REGEXP_LIKE)#17659xiangfu0 wants to merge 1 commit intoapache:masterfrom
xiangfu0 wants to merge 1 commit intoapache:masterfrom
Conversation
78d121f to
44db7aa
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17659 +/- ##
============================================
- Coverage 63.16% 63.12% -0.05%
- Complexity 1479 1500 +21
============================================
Files 3173 3177 +4
Lines 189917 190836 +919
Branches 29064 29216 +152
============================================
+ Hits 119970 120464 +494
- Misses 60621 61024 +403
- Partials 9326 9348 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 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.
What does this PR change?
evalMvas both:EvalMvTransformFunction) for block-based execution.EvalMvScalarFunction) for scalar execution paths.evalMvinTransformFunctionTypeandTransformFunctionFactory.EvalMvPredicateEvaluator.=,!=,>,>=,<,<=,IN,NOT IN,BETWEEN,LIKE,REGEXP_LIKE, plusAND/OR/NOT.EvalMvTransformFunctionTestunit coverage forREGEXP_LIKE.ArrayTestintegration coverage forREGEXP_LIKEwithuseBothQueryEngines.evalMv(mv_col, 'predicate')evaluates each MV element against the predicate and returns a filtered MV array.Why?
This addresses MV filtering semantics gaps (notably with MSE + MV columns) where filtering can keep all MV elements from a row once any element matches.
evalMvprovides explicit per-element filtering without requiringCROSS JOIN UNNEST.Query examples
1) MSE: filter MV values by
LIKE2) Both engines: filter MV values by
REGEXP_LIKEExpected first-row output:
['/api/v1', '/api/v2']for source['/api/v1', '/home', '/api/v2', '/metrics'].3) Both engines: use filtered MV result in row predicate
Validation
./mvnw -pl pinot-core -am -Dtest=EvalMvTransformFunctionTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -pl pinot-integration-tests -am -Dtest=ArrayTest -Dsurefire.failIfNoSpecifiedTests=false test