You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "SreeramGarlapati (via GitHub)" <gi...@apache.org> on 2026/05/30 03:33:47 UTC
[PR] fix: add space in decimal type serialization for cross-engine compat [iceberg-rust]
SreeramGarlapati opened a new pull request, #2538:
URL: https://github.com/apache/iceberg-rust/pull/2538
## Summary
iceberg-rust serializes the decimal type as `decimal(P,S)` (no space), while the Iceberg spec, Java, and Python all use `decimal(P, S)` (space after comma). This mismatch can cause issues when metadata written by iceberg-rust is read by strict parsers in other implementations.
### What changed
- `serialize_decimal`: `decimal({precision},{scale})` → `decimal({precision}, {scale})`
- `Display for PrimitiveType`: same fix for the decimal arm
- Updated the one test fixture that asserted the old format
### Why this is safe
The deserializer already uses `.trim()` on both precision and scale components, so it accepts both `decimal(9,2)` and `decimal(9, 2)`. Existing metadata files with the old format continue to be readable.
Closes #2534
## Test plan
- [x] All 1300+ iceberg crate tests pass
- [x] Workspace compiles cleanly
- [x] Backwards compat: deserializer handles both formats via trim()
--
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: add space in decimal type serialization for cross-engine compat [iceberg-rust]
Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk merged PR #2538:
URL: https://github.com/apache/iceberg-rust/pull/2538
--
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: add space in decimal type serialization for cross-engine compat [iceberg-rust]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #2538:
URL: https://github.com/apache/iceberg-rust/pull/2538#issuecomment-4624251631
> Interestingly the [spec](https://iceberg.apache.org/spec/#appendix-c-json-serialization) makes it seem like this is legitimate both with and without the space? It would appear that if other consumers are failing here, they're not compliant?
i feel like thats a formatting issue on the spec and not intention to have both the form with and without the space.
That said, the general principle with ser/de for iceberg project is [Postel’s Law](https://lawsofux.com/postels-law/#:~:text=Be%20liberal%20in%20what%20you,conservative%20in%20what%20you%20send.)
> Be liberal in what you accept, and conservative in what you send.
This is a great place to clarify the spec 😄 thanks for catching it!
--
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