xanderbailey commented on code in PR #2398:
URL: https://github.com/apache/iceberg-rust/pull/2398#discussion_r3976791054
##########
crates/iceberg/src/spec/values/decimal_utils.rs:
##########
@@ -196,6 +196,33 @@ pub fn i128_to_be_bytes_min(value: i128) -> Vec<u8> {
bytes[start..].to_vec()
}
+/// Encode an i128 as exactly `len` big-endian two's complement bytes,
matching a
+/// Parquet `FIXED_LEN_BYTE_ARRAY` column of that declared `type_length`.
+///
+/// Returns `None` if `value` does not fit in `len` bytes, since a truncated
+/// encoding would represent a different number.
+pub fn decimal_to_fixed_length_bytes_exact(value: i128, len: usize) ->
Option<Vec<u8>> {
Review Comment:
[1c4a8c1](https://github.com/apache/iceberg-rust/pull/2398/commits/1c4a8c1a5bd3b022606e92a8e4168b84de9c5e07)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]