Skip to content

Commit

Permalink
Fix decimal average signature
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 authored and zhouyuan committed Dec 19, 2023
1 parent 6ff0e99 commit fcd23a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions velox/functions/sparksql/aggregates/AverageAggregate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,15 @@ exec::AggregateRegistrationResult registerAverage(
.returnType("DECIMAL(r_precision, r_scale)")
.build());

signatures.push_back(
exec::AggregateFunctionSignatureBuilder()
.integerVariable("a_precision")
.integerVariable("a_scale")
.argumentType("DECIMAL(a_precision, a_scale)")
.intermediateType("ROW(DECIMAL(a_precision, a_scale), BIGINT)")
.returnType("DECIMAL(a_precision, a_scale)")
.build());

return exec::registerAggregateFunction(
name,
std::move(signatures),
Expand Down

0 comments on commit fcd23a5

Please sign in to comment.