Skip to content

Commit

Permalink
When only groupings exist, set the phase to be Single.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhejiangxiaomai committed Aug 18, 2022
1 parent cd7014d commit 60d1983
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions velox/substrait/SubstraitToVeloxPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ std::string SubstraitVeloxPlanConverter::findFuncSpec(uint64_t id) {
bool SubstraitVeloxPlanConverter::needsRowConstruct(
const ::substrait::AggregateRel& sAgg,
core::AggregationNode::Step& aggStep) {
if (sAgg.measures().size() == 0) {
// When only groupings exist, set the phase to be Single.
aggStep = core::AggregationNode::Step::kSingle;
return false;
}
for (const auto& smea : sAgg.measures()) {
auto aggFunction = smea.measure();
std::string funcName = subParser_->findVeloxFunction(
Expand Down

0 comments on commit 60d1983

Please sign in to comment.