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

Replace BrokerRequestOptimizer with QueryOptimizer to also optimize the PinotQuery #6423

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

Jackie-Jiang
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang commented Jan 8, 2021

Description

Currently broker only optimizes the filter in BrokerRequest, but leaves the filter in PinotQuery as is. Because of this, we can only use the filter from the BrokerRequest, which is inefficient because there is no native Expression support. It also blocks the PQL deprecation.

In this PR:

  • Attach the time boundary to PinotQuery.
  • Replace the BrokerRequestOptimizer with QueryOptimizer to also optimize the filter in PinotQuery.
  • in BrokerRequestToQueryContextConverter, use PinotQuery to generate QueryContext for SQL queries.

For backward-compatibility, Broker will optimize the filter in both BrokerRequest and PinotQuery.

Upgrade Notes

Please upgrade Brokers before Servers

@codecov-io
Copy link

codecov-io commented Jan 8, 2021

Codecov Report

Merging #6423 (042bae1) into master (1beaab5) will decrease coverage by 21.79%.
The diff coverage is 40.24%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #6423       +/-   ##
===========================================
- Coverage   66.44%   44.65%   -21.80%     
===========================================
  Files        1075     1320      +245     
  Lines       54773    64481     +9708     
  Branches     8168     9403     +1235     
===========================================
- Hits        36396    28792     -7604     
- Misses      15700    33333    +17633     
+ Partials     2677     2356      -321     
Flag Coverage Δ
integration 44.65% <40.24%> (?)

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

Impacted Files Coverage Δ
...ot/broker/broker/AllowAllAccessControlFactory.java 100.00% <ø> (ø)
.../helix/BrokerUserDefinedMessageHandlerFactory.java 52.83% <0.00%> (-13.84%) ⬇️
...org/apache/pinot/broker/queryquota/HitCounter.java 0.00% <0.00%> (-100.00%) ⬇️
...che/pinot/broker/queryquota/MaxHitRateTracker.java 0.00% <0.00%> (ø)
...ache/pinot/broker/queryquota/QueryQuotaEntity.java 0.00% <0.00%> (-50.00%) ⬇️
...ker/routing/instanceselector/InstanceSelector.java 100.00% <ø> (ø)
...ceselector/StrictReplicaGroupInstanceSelector.java 0.00% <0.00%> (ø)
...roker/routing/segmentpruner/TimeSegmentPruner.java 0.00% <0.00%> (ø)
...roker/routing/segmentpruner/interval/Interval.java 0.00% <0.00%> (ø)
...r/routing/segmentpruner/interval/IntervalTree.java 0.00% <0.00%> (ø)
... and 1304 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d24302...042bae1. Read the comment docs.

Copy link
Contributor

@xiangfu0 xiangfu0 left a comment

Choose a reason for hiding this comment

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

lgtm

@Jackie-Jiang Jackie-Jiang merged commit 4a89534 into apache:master Jan 21, 2021
@Jackie-Jiang Jackie-Jiang deleted the query_optimizer branch January 21, 2021 19:17
@mcvsubbu mcvsubbu added backward-incompat Referenced by PRs that introduce or fix backward compat issues release-notes Referenced by PRs that need attention when compiling the next release notes and removed backward-incompat Referenced by PRs that introduce or fix backward compat issues labels Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants