You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ga...@apache.org on 2026/07/11 16:04:06 UTC

(iceberg-cpp) branch main updated: refactor: use decimal high and low for Arrow scalar (#803)

This is an automated email from the ASF dual-hosted git repository.

wgtmac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 755799d1 refactor: use decimal high and low for Arrow scalar (#803)
755799d1 is described below

commit 755799d1ba4ae3d63ffa01cb7152cc796ed3ef52
Author: Junwang Zhao <zh...@gmail.com>
AuthorDate: Sun Jul 12 00:04:02 2026 +0800

    refactor: use decimal high and low for Arrow scalar (#803)
---
 src/iceberg/arrow/literal_util.cc | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/iceberg/arrow/literal_util.cc b/src/iceberg/arrow/literal_util.cc
index c1333819..e8ee4d6c 100644
--- a/src/iceberg/arrow/literal_util.cc
+++ b/src/iceberg/arrow/literal_util.cc
@@ -123,9 +123,7 @@ Result<std::shared_ptr<::arrow::Scalar>> ToArrowScalar(const Literal& literal,
       return std::make_shared<::arrow::DoubleScalar>(std::get<double>(value));
     case TypeId::kDecimal: {
       const auto& decimal = std::get<Decimal>(value);
-      ::arrow::Decimal128 arrow_decimal(
-          static_cast<int64_t>(decimal.value() >> 64),
-          static_cast<uint64_t>(decimal.value() & ~uint64_t{0}));
+      ::arrow::Decimal128 arrow_decimal(decimal.high(), decimal.low());
       return std::make_shared<::arrow::Decimal128Scalar>(arrow_decimal,
                                                          std::move(arrow_type));
     }