You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2025/06/04 06:59:21 UTC
[I] [DISCUSSION] How to represents decimal type? [iceberg-cpp]
mapleFU opened a new issue, #116:
URL: https://github.com/apache/iceberg-cpp/issues/116
For decimal type, iceberg-rust[1] uses rust_decimal[2] crate, and iceberg-java uses Java's BigDecimal[3]. iceberg-go uses a hand-written decimal [4]
We can uses a hand-written decimal in Literal. Or uses arrow's implemetation?
[1] https://github.com/apache/iceberg-rust/commits/e5d3aabf1a15892e89eca7850e32720d89e65e7c/crates/iceberg/src/spec/values.rs
[2] https://docs.rs/rust_decimal/latest/rust_decimal/
[3] https://github.com/apache/iceberg/blob/12605226736312970d787e704d4b7352a2bc2c1c/api/src/main/java/org/apache/iceberg/expressions/Literal.java#L22
[4] https://github.com/apache/iceberg-go/blob/ff2f3de32af5291ef4a35ce79978bb8000a9a5ff/types.go#L486
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] [DISCUSSION] How to represents decimal type? [iceberg-cpp]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on issue #116:
URL: https://github.com/apache/iceberg-cpp/issues/116#issuecomment-2939037534
We cannot use Arrow's decimal impl because `libiceberg` does not depend on Arrow but only nanoarrow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] [DISCUSSION] How to represents decimal type? [iceberg-cpp]
Posted by "zhjwpku (via GitHub)" <gi...@apache.org>.
zhjwpku commented on issue #116:
URL: https://github.com/apache/iceberg-cpp/issues/116#issuecomment-3193616607
After experimenting on Godbolt, I found that using the following declaration works well to represent int128_t. However, when trying to build Decimal128 with it, I realized that adapting certain decimal functions becomes difficult and the implementation is prone to bugs. Therefore, I decide to follow Arrow's approach and extract the Decimal128 implementation from Arrow into iceberg-cpp. Adoption of int128_t can come later if we found it necessary.
```
#if defined(_MSC_VER)
# include <__msvc_int128.hpp>
using int128_t = ::std::_Signed128;
using uint128_t = ::std::_Unsigned128;
#elif defined(__GNUC__) || defined(__clang__)
using int128_t = __int128;
using uint128_t = unsigned __int128;
#else
# error "128-bit integer type is not supported on this platform"
#endif
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] [DISCUSSION] How to represents decimal type? [iceberg-cpp]
Posted by "zhjwpku (via GitHub)" <gi...@apache.org>.
zhjwpku closed issue #116: [DISCUSSION] How to represents decimal type?
URL: https://github.com/apache/iceberg-cpp/issues/116
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] [DISCUSSION] How to represents decimal type? [iceberg-cpp]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on issue #116:
URL: https://github.com/apache/iceberg-cpp/issues/116#issuecomment-3194445141
Agreed. We can use the battle-tested implementation from Arrow for now and switch to other alternatives if needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] [DISCUSSION] How to represents decimal type? [iceberg-cpp]
Posted by "zhjwpku (via GitHub)" <gi...@apache.org>.
zhjwpku commented on issue #116:
URL: https://github.com/apache/iceberg-cpp/issues/116#issuecomment-3298610168
#182 has been merged into main, so this issue can now be closed. I'll be working on adding Literal support for Decimal in the coming days, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org