Skip to content

Commit 755799d

Browse files
authored
refactor: use decimal high and low for Arrow scalar (#803)
1 parent aa36d35 commit 755799d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/iceberg/arrow/literal_util.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ Result<std::shared_ptr<::arrow::Scalar>> ToArrowScalar(const Literal& literal,
123123
return std::make_shared<::arrow::DoubleScalar>(std::get<double>(value));
124124
case TypeId::kDecimal: {
125125
const auto& decimal = std::get<Decimal>(value);
126-
::arrow::Decimal128 arrow_decimal(
127-
static_cast<int64_t>(decimal.value() >> 64),
128-
static_cast<uint64_t>(decimal.value() & ~uint64_t{0}));
126+
::arrow::Decimal128 arrow_decimal(decimal.high(), decimal.low());
129127
return std::make_shared<::arrow::Decimal128Scalar>(arrow_decimal,
130128
std::move(arrow_type));
131129
}

0 commit comments

Comments
 (0)