Skip to content

Commit 871b01f

Browse files
committed
Fix
1 parent f184fca commit 871b01f

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

velox/common/memory/SharedArbitrator.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,11 @@ uint64_t SharedArbitrator::reclaim(
424424
const uint64_t newCapacity = pool->capacity();
425425
VELOX_CHECK_GE(oldCapacity, newCapacity);
426426
reclaimedBytes = oldCapacity - newCapacity;
427-
numReclaimedBytes_ += reclaimedBytes - freedBytes;
428-
numShrunkBytes_ += freedBytes;
429-
reclaimTimeUs_ += reclaimDurationUs;
430-
return reclaimedBytes;
427+
numReclaimedBytes_ += reclaimedBytes - freedBytes;
428+
numShrunkBytes_ += freedBytes;
429+
reclaimTimeUs_ += reclaimDurationUs;
430+
return reclaimedBytes;
431+
}
431432
}
432433

433434
void SharedArbitrator::abort(

velox/functions/sparksql/DecimalVectorFunctions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ class DecimalRoundFunction : public exec::VectorFunction {
235235
uint8_t rScale,
236236
int32_t scale) const {
237237
if (scale >= 0) {
238+
bool isOverflow = false;
238239
auto rescaledValue = DecimalUtil::rescaleWithRoundUp<A, R>(
239-
a, aPrecision, aScale, rPrecision, rScale);
240+
a, aPrecision, aScale, rPrecision, rScale, isOverflow);
240241
VELOX_DCHECK(rescaledValue.has_value());
241242
r = rescaledValue.value();
242243
} else {

velox/functions/sparksql/aggregates/AverageAggregate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ class DecimalAverageAggregate : public DecimalAggregate<TInputType> {
280280

281281
DecimalUtil::divideWithRoundUp<int128_t, int128_t, int128_t>(
282282
avg, validSum.value(), countDecimal, false, sumRescale, 0);
283+
bool isOverflow = false;
283284
return DecimalUtil::rescaleWithRoundUp<int128_t, TResultType>(
284-
avg, avgPrecision, avgScale, resultPrecision, resultScale);
285+
avg, avgPrecision, avgScale, resultPrecision, resultScale, isOverflow);
285286
}
286287

287288
private:

velox/functions/sparksql/aggregates/DecimalSumAggregate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class DecimalSumAggregate : public exec::Aggregate {
7474

7575
auto [resultPrecision, resultScale] =
7676
getDecimalPrecisionScale(*sumType_.get());
77-
overflow = !DecimalUtil::valueInRangeWithPrecision(sum, resultPrecision);
77+
overflow = !DecimalUtil::valueInPrecisionRange(sum, resultPrecision);
7878
return sum;
7979
}
8080

0 commit comments

Comments
 (0)