[Planner] Support disabling rule by default and enabling it with a queryOption#16238
Merged
Jackie-Jiang merged 7 commits intoapache:masterfrom Jul 7, 2025
Merged
Conversation
Added queryOption `usePlannerRules` that works similarly to `skipPlannerRules`. It takes the comma separated list of rules that are disabled by default that to be used. It only applies to defaultly disabled rules, which is defined in a static set: `CommonConstants.Broker#DEFAULT_DISABLED_RULES`. If a rule is set to be enabled and disabled by queryOption at the same time, it is disabled. Added `SortJoinTransposeRule`, `SortJoinCopyRule`, and `AggregateJoinTransposeRule.EXTENDED` in `BASIC_RULES` to be disabled by default. Adjusted the skipping logic to use empty set instead of null when no options are provided to avoid NPEs.
…ISABLED_RULES" This reverts commit 27aec78.
d87da19 to
67bb85c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #16238 +/- ##
============================================
+ Coverage 62.90% 63.18% +0.28%
+ Complexity 1386 1362 -24
============================================
Files 2867 2960 +93
Lines 163354 171005 +7651
Branches 24952 26176 +1224
============================================
+ Hits 102755 108052 +5297
- Misses 52847 54770 +1923
- Partials 7752 8183 +431
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:
|
Jackie-Jiang
approved these changes
Jul 1, 2025
Contributor
Jackie-Jiang
left a comment
There was a problem hiding this comment.
cc @gortiz to also take a look
pinot-common/src/main/java/org/apache/pinot/common/utils/config/QueryOptionsUtils.java
Outdated
Show resolved
Hide resolved
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotQueryRuleSets.java
Outdated
Show resolved
Hide resolved
songwdfu
added a commit
to songwdfu/pinot
that referenced
this pull request
Jul 8, 2025
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.
Added queryOption
usePlannerRulesthat works similarly toskipPlannerRulesEnable dynamically turning on/off optProgram rules #15999 .It takes the comma separated list of rules that are disabled by default that user want to enable.
It only applies to defaultly disabled rules, which is defined in a static set:
CommonConstants.Broker#DEFAULT_DISABLED_RULES.If a rule is set to be enabled and disabled by queryOption at the same time, it is disabled.
Added calcite
SortJoinTransposeRule,SortJoinCopyRule, andAggregateJoinTransposeRule.EXTENDEDinBASIC_RULESto be disabled by default.Added tests that test these rules are disabled by default and could be enabled in
QueryPlannerRuleOptionsTest(minor) Adjusted the skipping logic to use empty set instead of null when no options are provided to avoid NPEs.