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

[Multi-stage] Clean up unnecessary checks in rules #14066

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

Jackie-Jiang
Copy link
Contributor

  • Remove unnecessary checks in matches()
  • Use copy() instead of create() if we are modifying a RelNode to preserve the hints

@Jackie-Jiang Jackie-Jiang added cleanup multi-stage Related to the multi-stage query engine labels Sep 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 65.02%. Comparing base (59551e4) to head (a740dc8).
Report is 1080 commits behind head on master.

Files with missing lines Patch % Lines
...alcite/rel/rules/PinotExchangeEliminationRule.java 33.33% 2 Missing ⚠️
...rel/rules/PinotSingleValueAggregateRemoveRule.java 71.42% 2 Missing ⚠️
...ite/rel/rules/PinotJoinExchangeNodeInsertRule.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14066      +/-   ##
============================================
+ Coverage     61.75%   65.02%   +3.27%     
- Complexity      207     1533    +1326     
============================================
  Files          2436     2564     +128     
  Lines        133233   140692    +7459     
  Branches      20636    21592     +956     
============================================
+ Hits          82274    91482    +9208     
+ Misses        44911    42491    -2420     
- Partials       6048     6719     +671     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 64.98% <93.33%> (+3.27%) ⬆️
java-21 64.91% <93.33%> (+3.29%) ⬆️
skip-bytebuffers-false 65.02% <93.33%> (+3.27%) ⬆️
skip-bytebuffers-true 64.89% <93.33%> (+37.16%) ⬆️
temurin 65.02% <93.33%> (+3.27%) ⬆️
unittests 65.01% <93.33%> (+3.27%) ⬆️
unittests1 56.51% <93.33%> (+9.62%) ⬆️
unittests2 35.03% <14.66%> (+7.29%) ⬆️

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.

Comment on lines +51 to +53
super(operand(Aggregate.class,
some(operand(Join.class, some(operand(RelNode.class, any()), operand(Aggregate.class, any()))))), factory,
null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I would recommend to start using the new way to instantiate rules instead of this one, which is deprecated. See PinotImplicitTableHintRule in #13943.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I also noticed that. PinotSortExchangeCopyRule is also using the config in the constructor (I believe the benefit is to allow reusing the same rule to match different trees).
We can use a separate PR to clean this up.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've recently ended up reading Hive's CalcitePlanner class, which is pretty similar to our QueryEnvironment class and I think that is something we can get inspiration of once our rule logic starts to be more complex.

@Jackie-Jiang Jackie-Jiang merged commit c80b8fd into apache:master Sep 24, 2024
21 checks passed
@Jackie-Jiang Jackie-Jiang deleted the remove_extra_override branch September 24, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup multi-stage Related to the multi-stage query engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants