Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds per-column, query-time index skip option #12414

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

egalpin
Copy link
Member

@egalpin egalpin commented Feb 13, 2024

Closes #12355. Needs tests but opening for early feedback.

cc @kishoreg @Jackie-Jiang

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2024

Codecov Report

Attention: Patch coverage is 65.11628% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 61.76%. Comparing base (7c9bf8c) to head (a946055).
Report is 51 commits behind head on master.

Files Patch % Lines
...inot/core/operator/filter/FilterOperatorUtils.java 35.71% 1 Missing and 8 partials ⚠️
...ava/org/apache/pinot/core/plan/FilterPlanNode.java 33.33% 0 Missing and 4 partials ⚠️
...pinot/core/query/request/context/QueryContext.java 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12414      +/-   ##
============================================
- Coverage     61.77%   61.76%   -0.01%     
  Complexity      207      207              
============================================
  Files          2425     2437      +12     
  Lines        132753   133263     +510     
  Branches      20535    20651     +116     
============================================
+ Hits          82005    82310     +305     
- Misses        44730    44891     +161     
- Partials       6018     6062      +44     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 61.71% <65.11%> (+26.75%) ⬆️
java-21 61.63% <65.11%> (-0.02%) ⬇️
skip-bytebuffers-false 61.73% <65.11%> (+0.01%) ⬆️
skip-bytebuffers-true 61.60% <65.11%> (-0.01%) ⬇️
temurin 61.76% <65.11%> (-0.01%) ⬇️
unittests 61.76% <65.11%> (-0.01%) ⬇️
unittests1 46.88% <65.11%> (-0.04%) ⬇️
unittests2 27.74% <0.00%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jackie-Jiang Jackie-Jiang added feature release-notes Referenced by PRs that need attention when compiling the next release notes labels Feb 14, 2024
@egalpin
Copy link
Member Author

egalpin commented Feb 21, 2024

tests added, this is ready for review.

@gortiz
Copy link
Contributor

gortiz commented Feb 22, 2024

It LGTM. As said in the linked issue, my main concern is on the language to use. I think URL args is fine, but maybe we would need to have a bigger picture because the language we decide to use here is what we should use in future options with the same type

for (String columnConf : perColumnIndexSkip) {
String[] conf = columnConf.split("=");
if (conf.length != 2) {
continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we fail in this case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, ya. I feel like failed parsing is better to end up as a failed query than a successful query without the intended options set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gortiz would a org.apache.pinot.sql.parsers.parser.ParseException be a good choice here? I don't know if that exception is reserved for SQL not including query options, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like there isn't precedent for throwing exceptions from within InstancePlanMakerImplV2#applyQueryOptions, so the "easiest" would be a RuntimeException

@egalpin
Copy link
Member Author

egalpin commented Feb 26, 2024

@gortiz anything that needs attention at the moment? I want to be sure I've addressed any comments and can't find any unaddressed at the moment.

@gortiz gortiz merged commit 5dc807b into apache:master Feb 27, 2024
19 checks passed
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late comments. Can you also help add some documentation for this new query option?

return null;
}

String[] perColumnIndexSkip = indexSkipConfigStr.split("&");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using StringUtils.split(indexSkipConfigStr, '&') which is more lightweight. The current API will try to do regex match. Same for other split calls

@@ -361,6 +361,7 @@ public static class QueryOptionKey {
public static final String SERVER_RETURN_FINAL_RESULT = "serverReturnFinalResult";
// Reorder scan based predicates based on cardinality and number of selected values
public static final String AND_SCAN_REORDERING = "AndScanReordering";
public static final String INDEX_SKIP_CONFIG = "indexSkipConfig";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(personal preference) I feel skipIndexes is more consistent with other option keys

@egalpin
Copy link
Member Author

egalpin commented Feb 28, 2024

@Jackie-Jiang I'll make a follow-up PR to address these by end of week

@npawar
Copy link
Contributor

npawar commented May 22, 2024

Do we have documentation for this @egalpin ?

@egalpin
Copy link
Member Author

egalpin commented May 22, 2024

@npawar Ah, thank you for the reminder! No, there's no formal docs for this yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation feature release-notes Referenced by PRs that need attention when compiling the next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add QueryOption support for column-level index skipping at query time
5 participants