Skip to content

[Planner] Support disabling rule by default and enabling it with a queryOption#16238

Merged
Jackie-Jiang merged 7 commits intoapache:masterfrom
songwdfu:disable-rules-by-default
Jul 7, 2025
Merged

[Planner] Support disabling rule by default and enabling it with a queryOption#16238
Jackie-Jiang merged 7 commits intoapache:masterfrom
songwdfu:disable-rules-by-default

Conversation

@songwdfu
Copy link
Contributor

@songwdfu songwdfu commented Jun 30, 2025

  1. Added queryOption usePlannerRules that works similarly to skipPlannerRules Enable 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.

  2. Added calcite SortJoinTransposeRule, SortJoinCopyRule, and AggregateJoinTransposeRule.EXTENDED in BASIC_RULES to be disabled by default.

  3. 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.

songwdfu added 2 commits June 30, 2025 16:02
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.
@songwdfu songwdfu marked this pull request as ready for review June 30, 2025 20:20
@songwdfu songwdfu force-pushed the disable-rules-by-default branch from d87da19 to 67bb85c Compare June 30, 2025 20:52
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.18%. Comparing base (1a476de) to head (59735cd).
Report is 375 commits behind head on master.

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     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.16% <100.00%> (+0.29%) ⬆️
java-21 63.14% <100.00%> (+0.32%) ⬆️
skip-bytebuffers-false ?
skip-bytebuffers-true ?
temurin 63.18% <100.00%> (+0.28%) ⬆️
unittests 63.18% <100.00%> (+0.28%) ⬆️
unittests1 64.72% <100.00%> (+8.90%) ⬆️
unittests2 33.42% <55.55%> (-0.15%) ⬇️

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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

cc @gortiz to also take a look

@Jackie-Jiang Jackie-Jiang merged commit 0310a35 into apache:master Jul 7, 2025
18 checks passed
songwdfu added a commit to songwdfu/pinot that referenced this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants