Skip to content

Commit

Permalink
Revert "fix UT castDecimalToDecimal and varcharToDecimal (#449)" (#450)
Browse files Browse the repository at this point in the history
This reverts commit d16ea4e.
  • Loading branch information
zhouyuan authored Nov 27, 2023
1 parent d16ea4e commit 7efd16f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions velox/type/DecimalUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,7 @@ class DecimalUtil {
}
// Check overflow.
if (!valueInPrecisionRange(rescaledValue, toPrecision) || isOverflow) {
if (throwIfOverflow) {
VELOX_USER_FAIL(
"Cannot cast DECIMAL '{}' to DECIMAL({}, {})",
DecimalUtil::toString(
inputValue, DECIMAL(fromPrecision, fromScale)),
toPrecision,
toScale);
} else {
isOverflow = true;
return std::nullopt;
}
return std::nullopt;
}
return static_cast<TOutput>(rescaledValue);
}
Expand Down

0 comments on commit 7efd16f

Please sign in to comment.