Skip to content

[multistage] Support range queries in search#11512

Merged
xiangfu0 merged 2 commits intoapache:masterfrom
gortiz:supportSearchRange
Sep 6, 2023
Merged

[multistage] Support range queries in search#11512
xiangfu0 merged 2 commits intoapache:masterfrom
gortiz:supportSearchRange

Conversation

@gortiz
Copy link
Contributor

@gortiz gortiz commented Sep 5, 2023

This PR fixes an error I detected while trying to run all integration tests with V2. It seems that some queries are translated in V2 using SqlKind.SEARCH. We added partial support for that when implementing IN (for example in #9374) but that was limited to cases where SEARCH used literals (like in IN expressions).

I've tried to exercise my code with more tests, but I wasn't able to create SQL queries that were translated into SqlKind.SEARCH. Therefore I've just modified the original test to run in both V1 and V2. It seems the kind of queries that are translated into this pattern are things like:

SELECT ArrDelay > 50 OR ArrDelay < 10 FROM mytable

but not queries like:

SELECT 1 FROM mytable where ArrDelay > 50 OR ArrDelay < 10 LIMIT 1000

@gortiz
Copy link
Contributor Author

gortiz commented Sep 5, 2023

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Merging #11512 (e98d73f) into master (5baf566) will decrease coverage by 0.01%.
Report is 5 commits behind head on master.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master   #11512      +/-   ##
============================================
- Coverage     63.03%   63.03%   -0.01%     
+ Complexity     1109     1108       -1     
============================================
  Files          2320     2320              
  Lines        124524   124566      +42     
  Branches      19011    19019       +8     
============================================
+ Hits          78495    78518      +23     
- Misses        40436    40456      +20     
+ Partials       5593     5592       -1     
Flag Coverage Δ
integration <0.01% <0.00%> (ø)
integration1 <0.01% <0.00%> (ø)
integration2 0.00% <0.00%> (ø)
java-11 62.99% <0.00%> (-0.01%) ⬇️
java-17 62.87% <0.00%> (-0.03%) ⬇️
java-20 62.88% <0.00%> (-0.02%) ⬇️
temurin 63.03% <0.00%> (-0.01%) ⬇️
unittests 63.02% <0.00%> (-0.01%) ⬇️
unittests1 67.50% <0.00%> (-0.04%) ⬇️
unittests2 14.45% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...inot/query/planner/logical/RexExpressionUtils.java 55.46% <0.00%> (-31.38%) ⬇️

... and 13 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gortiz
Copy link
Contributor Author

gortiz commented Sep 5, 2023

See also #11412 and #11404

@gortiz gortiz force-pushed the supportSearchRange branch from 4f4e67d to e98d73f Compare September 5, 2023 16:45
@xiangfu0 xiangfu0 added the multi-stage Related to the multi-stage query engine label Sep 6, 2023
@xiangfu0 xiangfu0 changed the title Support range queries in search [multistage] Support range queries in search Sep 6, 2023
@xiangfu0 xiangfu0 added the query label Sep 6, 2023
@xiangfu0 xiangfu0 merged commit e949d95 into apache:master Sep 6, 2023
@gortiz gortiz deleted the supportSearchRange branch September 6, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement multi-stage Related to the multi-stage query engine query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants