-
Notifications
You must be signed in to change notification settings - Fork 589
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
fix(optimizer): fix lookup join and agg distribution derive #6833
fix(optimizer): fix lookup join and agg distribution derive #6833
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6833 +/- ##
==========================================
- Coverage 73.22% 73.22% -0.01%
==========================================
Files 1026 1026
Lines 164162 164168 +6
==========================================
+ Hits 120207 120210 +3
- Misses 43955 43958 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
BatchExchange { order: [], dist: Single } | ||
└─BatchHashAgg { group_key: [t2.c, t2.d], aggs: [count(t.a)] } | ||
└─BatchExchange { order: [], dist: HashShard(t2.c, t2.d) } | ||
└─BatchHashAgg { group_key: [t2.c, t2.d, t.a], aggs: [] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this pr, we can not derive the group_key here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this pr, we will miss a exchange here.
Will #6642 be caused by this? 🤔 |
- name: test index join distribution derive | ||
sql: | | ||
set rw_batch_enable_lookup_join = true; | ||
set query_mode = distributed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the batch_plan
must be distributed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, our query execution mode by default is local
, so we need to set it to distributed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we always generate distributed plan. For local plan, we use the local_batch_plan
field.
risingwave/src/frontend/planner_test/src/lib.rs
Lines 468 to 479 in 672c049
let batch_plan = match logical_plan.gen_batch_distributed_plan() { | |
Ok(batch_plan) => batch_plan, | |
Err(err) => { | |
ret.batch_error = Some(err.to_string()); | |
break 'batch; | |
} | |
}; | |
// Only generate batch_plan if it is specified in test case | |
if self.batch_plan.is_some() { | |
ret.batch_plan = Some(explain_plan(&batch_plan)); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I can remove it in this #6818 PR together.
set rw_batch_enable_lookup_join = true;
set query_mode = distributed;
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
PLEASE DO NOT LEAVE THIS EMPTY !!!
Please explain IN DETAIL what the changes are in this PR and why they are needed:
output_indices
forBatchLookupJoin
.UpstreamHashShard
forBatchHashAgg
,BatchSortAgg
,StreamHashAgg
.Checklist
./risedev check
(or alias,./risedev c
)Documentation
If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.
Types of user-facing changes
Please keep the types that apply to your changes, and remove those that do not apply.
Release note
Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.
Refer to a related PR or issue link (optional)