diff --git a/velox/functions/sparksql/aggregates/SumAggregate.cpp b/velox/functions/sparksql/aggregates/SumAggregate.cpp index 6b992615df1f..777e52b0f3cb 100644 --- a/velox/functions/sparksql/aggregates/SumAggregate.cpp +++ b/velox/functions/sparksql/aggregates/SumAggregate.cpp @@ -113,12 +113,11 @@ exec::AggregateRegistrationResult registerSum( BIGINT()); } case TypeKind::HUGEINT: { - if (inputType->isLongDecimal()) { - // If inputType is long decimal, - // its output type is always long decimal. - return std::make_unique>>(resultType); - } + VELOX_CHECK(inputType->isLongDecimal()); + // If inputType is long decimal, + // its output type is always long decimal. + return std::make_unique>>(resultType); } case TypeKind::REAL: if (resultType->kind() == TypeKind::REAL) {