Skip to content

Commit

Permalink
Revert "Fix decimal agg signature on partial companion function (oap-…
Browse files Browse the repository at this point in the history
…project#465)"

This reverts commit 336d61f.
  • Loading branch information
zhztheplayer committed Jan 2, 2024
1 parent 3f6c8e9 commit 070e820
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 1 addition & 3 deletions velox/functions/sparksql/aggregates/AverageAggregate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,7 @@ exec::AggregateRegistrationResult registerAverage(
auto inputScale = inputType->asShortDecimal().scale();
auto sumType =
DECIMAL(std::min(38, inputPrecision + 10), inputScale);
if (exec::isPartialOutput(step) ||
(step == core::AggregationNode::Step::kSingle &&
resultType->isRow())) {
if (exec::isPartialOutput(step)) {
return std::make_unique<
DecimalAverageAggregate<int64_t, int64_t>>(
resultType, sumType);
Expand Down
8 changes: 1 addition & 7 deletions velox/functions/sparksql/aggregates/SumAggregate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ using SumAggregate = SumAggregateBase<TInput, TAccumulator, ResultType, true>;
TypePtr getDecimalSumType(
const TypePtr& resultType,
core::AggregationNode::Step step) {
if (exec::isPartialOutput(step)) {
return resultType->childAt(0);
}
if (step == core::AggregationNode::Step::kSingle && resultType->isRow()) {
return resultType->childAt(0);
}
return resultType;
return exec::isPartialOutput(step) ? resultType->childAt(0) : resultType;
}
} // namespace

Expand Down

0 comments on commit 070e820

Please sign in to comment.