You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/05/20 18:54:41 UTC
[PR] fix(spec): support JSON binary literals [iceberg-rust]
fallintoplace opened a new pull request, #2476:
URL: https://github.com/apache/iceberg-rust/pull/2476
### Summary
- implement JSON hex parsing for `binary` and `fixed` literals
- serialize binary-like literals as two-character-per-byte lowercase hex
- validate `fixed[N]` JSON values have exactly `N` decoded bytes
- add coverage for valid hex, uppercase input, invalid hex, and fixed-size mismatches
### Why
The previous JSON literal parser used `todo!()` for `binary` and `fixed`, so valid JSON values could panic. Serialization also emitted bytes without zero padding, which could collapse byte boundaries for values containing `0x00` through `0x0f`.
Fixes #2475.
### Tests
- `cargo fmt --check`
- `cargo test -p iceberg json`
- `cargo test -p iceberg spec::values`
- `cargo test -p iceberg`
--
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: [PR] fix(spec): support JSON binary literals [iceberg-rust]
Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk commented on code in PR #2476:
URL: https://github.com/apache/iceberg-rust/pull/2476#discussion_r3279620496
##########
crates/iceberg/src/spec/values/tests.rs:
##########
@@ -251,6 +251,78 @@ fn json_decimal() {
);
}
+#[test]
+fn test_should_serde_json_binary_if_value_is_hex_encoded() {
Review Comment:
nit: Why not just `json_binary` similar to other tests?
##########
crates/iceberg/src/spec/values/tests.rs:
##########
@@ -251,6 +251,78 @@ fn json_decimal() {
);
}
+#[test]
+fn test_should_serde_json_binary_if_value_is_hex_encoded() {
+ let record = r#""00010fff""#;
+
+ check_json_serde(
+ record,
+ Literal::Primitive(PrimitiveLiteral::Binary(vec![0, 1, 15, 255])),
+ &Type::Primitive(PrimitiveType::Binary),
+ );
+}
+
+#[test]
+fn test_should_serde_json_fixed_if_value_is_hex_encoded() {
Review Comment:
Ditto.
--
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: [PR] fix(spec): support JSON binary literals [iceberg-rust]
Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk merged PR #2476:
URL: https://github.com/apache/iceberg-rust/pull/2476
--
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