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:18:09 UTC

[I] decimal type serialized as decimal(P,S) — diverges from spec/java/python [iceberg-rust]

SreeramGarlapati opened a new issue, #2534:
URL: https://github.com/apache/iceberg-rust/issues/2534

   ## problem
   
   iceberg-rust serializes the decimal type as `decimal(9,2)` (no space after comma). both java and python serialize as `decimal(9, 2)` (with space). the iceberg spec documents the type as `decimal(P, S)`.
   
   strict downstream parsers that expect the canonical form reject the spaceless variant.
   
   ## current behavior
   
   ```rust
   // crates/iceberg/src/spec/datatypes.rs
   write!(f, "decimal({precision},{scale})")
   ```
   
   produces: `"decimal(9,2)"`
   
   ## expected behavior
   
   ```rust
   write!(f, "decimal({precision}, {scale})")
   ```
   
   produces: `"decimal(9, 2)"` — matching java (`String.format("decimal(%d, %d)", ...)`) and python (`f"decimal({self.precision}, {self.scale})"`).
   
   ## impact
   
   - all existing parsers (java, python, rust) handle both forms via `.trim()` — no breaking change
   - aligns iceberg-rust output with the canonical form used by the other two major implementations
   - one-character fix in the format string
   
   ## notes
   
   the deserializer already handles both formats correctly (trims whitespace after comma split). this is purely about output alignment.


-- 
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] decimal type serialized as decimal(P,S) — diverges from spec/java/python [iceberg-rust]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #2534:
URL: https://github.com/apache/iceberg-rust/issues/2534#issuecomment-4699793172

   I opened a PR to fix the formatting for the spec, https://github.com/apache/iceberg/pull/16798
   
   The canonical representation should contain space `decimal(P, S)` but readers should also accept `decimal(P,S)` (without space). Java accepts 


-- 
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] decimal type serialized as decimal(P,S) — diverges from spec/java/python [iceberg-rust]

Posted by "blackmwk (via GitHub)" <gi...@apache.org>.
blackmwk closed issue #2534: decimal type serialized as decimal(P,S) — diverges from spec/java/python
URL: https://github.com/apache/iceberg-rust/issues/2534


-- 
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] decimal type serialized as decimal(P,S) — diverges from spec/java/python [iceberg-rust]

Posted by "dannycjones (via GitHub)" <gi...@apache.org>.
dannycjones commented on issue #2534:
URL: https://github.com/apache/iceberg-rust/issues/2534#issuecomment-4635936312

   @SreeramGarlapati are you able to share any details on the stricter downstream parsers?
   
   From the discussion on #2538, the current implementation is spec compliant as is the change. The real fix should be for the downstream parsers to tolerate both forms.


-- 
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