Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 committed Oct 3, 2023
1 parent e1fcaa5 commit fdaf27d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions velox/functions/sparksql/aggregates/DecimalSumAggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DecimalSumAggregate : public exec::Aggregate {

auto [resultPrecision, resultScale] =
getDecimalPrecisionScale(*sumType_.get());
overflow = !DecimalUtil::valueInRangeWithPrecision(sum, resultPrecision);
overflow = !DecimalUtil::valueInPrecisionRange(sum, resultPrecision);
return sum;
}

Expand Down Expand Up @@ -131,7 +131,8 @@ class DecimalSumAggregate : public exec::Aggregate {
for (auto i = 0; i < numGroups; ++i) {
char* group = groups[i];
if (isNull(group)) {
rowVector->setNull(i, true);
rawSums[i] = 0;
bits::setBit(rawIsEmpty, i, true);
} else {
clearNull(rawNulls, i);
auto* decimalSum = accumulator(group);
Expand Down

0 comments on commit fdaf27d

Please sign in to comment.