-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(runner): Fix broadcast in LocalRunner #11923
base: main
Are you sure you want to change the base?
Conversation
Summary: This diff adds a unit test of LocalRunner with a broadcast node in the query plan and fixes the handling of broadcast in LocalRunner. Differential Revision: D67549347
This pull request was exported from Phabricator. Differential Revision: D67549347 |
✅ Deploy Preview for meta-velox canceled.
|
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.
@kagamiori looks good overall % comments. Thanks!
VELOX_CHECK_NOT_NULL(output); | ||
const auto producerPrefix = current_->taskPrefix; | ||
auto result = planNode_; | ||
newFragment(); |
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.
Leave an empty line here.
root_->stack_.pop_back(); | ||
auto* consumer = root_->stack_.back(); | ||
fragments_.back().numBroadcastDestinations = consumer->current_->width; | ||
VELOX_CHECK_GE(consumer->current_->width, 1); |
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.
We should check width before its use, and we shall also check numBroadcastDestinations is not set in the previous fragment yet.
} | ||
exchange(output->outputType(), VectorSerde::Kind::kPresto); | ||
auto* exchange = dynamic_cast<const core::ExchangeNode*>(planNode_.get()); | ||
consumer->current_->inputStages.push_back( |
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.
add a non null check on exchange after cast
@@ -108,6 +108,29 @@ core::PlanNodePtr DistributedPlanBuilder::shuffleResult( | |||
return std::move(planNode_); | |||
} | |||
|
|||
core::PlanNodePtr DistributedPlanBuilder::broadcastResult() { |
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.
Shall we call this shuffleBroadcastResult? And rename the existing one to shufflePartitionedResult?
const auto producerPrefix = current_->taskPrefix; | ||
auto result = planNode_; | ||
newFragment(); | ||
root_->stack_.pop_back(); |
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.
Can we check if stack is empty on dtor? And we should expect stack is not empty when calling non-result APIs from DistributedPlanBuilder? Thanks!
Summary: This diff adds a unit test of LocalRunner with a broadcast node in the query plan and fixes the handling of broadcast in LocalRunner.
Differential Revision: D67549347