Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Feb 26, 2024
1 parent bdd09e4 commit 1fbea79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion velox/type/DecimalUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class DecimalUtil {
static_cast<uint128_t>(value > 0 ? value : -value);
const auto integralDigits =
integralValue == 0 ? 0 : countDigits(integralValue);
const auto fractionDigits = digits - integralDigits;
const auto fractionDigits = std::max(digits - integralDigits, 0);
/// Scales up the input value to keep all the precise fractional digits
/// before rounding. Convert value to long double type, as double * int128_t
/// returns int128_t and fractional digits are lost. No need to consider
Expand Down
9 changes: 6 additions & 3 deletions velox/vector/arrow/tests/ArrowBridgeArrayTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ class ArrowBridgeArrayExportTest : public testing::Test {
break;
default:
VELOX_USER_FAIL(fmt::format(
"Timestamp unit not supported: {}.", options_.timestampUnit));
"Timestamp unit not supported: {}.",
(int8_t)options_.timestampUnit));
}
} else {
EXPECT_EQ(inputData[i], values[i]) << "mismatch at index " << i;
Expand Down Expand Up @@ -1034,7 +1035,8 @@ class ArrowBridgeArrayImportTest : public ArrowBridgeArrayExportTest {
break;
default:
VELOX_USER_FAIL(fmt::format(
"Timestamp unit not supported: {}.", options_.timestampUnit));
"Timestamp unit not supported: {}.",
(int8_t)options_.timestampUnit));
}
} else {
rawValues[i] = *inputValues[i];
Expand Down Expand Up @@ -1180,7 +1182,8 @@ class ArrowBridgeArrayImportTest : public ArrowBridgeArrayExportTest {
break;
default:
VELOX_USER_FAIL(fmt::format(
"Timestamp unit not supported: {}.", options_.timestampUnit));
"Timestamp unit not supported: {}.",
(int8_t)options_.timestampUnit));
}
}
} else {
Expand Down

0 comments on commit 1fbea79

Please sign in to comment.