Skip to content

decimal type serialized as decimal(P,S) — diverges from spec/java/python #2534

@SreeramGarlapati

Description

@SreeramGarlapati

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

// crates/iceberg/src/spec/datatypes.rs
write!(f, "decimal({precision},{scale})")

produces: "decimal(9,2)"

expected behavior

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions