fix(spec): use canonical fixed[N] type string in PrimitiveType Display#2798
Open
laskoviymishka wants to merge 1 commit into
Open
fix(spec): use canonical fixed[N] type string in PrimitiveType Display#2798laskoviymishka wants to merge 1 commit into
laskoviymishka wants to merge 1 commit into
Conversation
`Display` emitted `fixed(N)`, diverging from the canonical `fixed[N]` used by the serde path and the Go/Java references. Align Display and add a regression test pinning Display/Serialize/Deserialize to one string.
huan233usc
approved these changes
Jul 10, 2026
huan233usc
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for the fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
What changes are included in this PR?
PrimitiveType'sDisplayimpl emittedfixed(N)(parentheses), diverging from thecanonical Iceberg type string
fixed[N](square brackets) used everywhere else:serialize_fixedalready emitsfixed[{value}]anddeserialize_fixedparsesfixed[;Types.FixedType.toString()) andiceberg-go (
FixedType.String()) both usefixed[N], as does PyIceberg.Fixedwas the onlyDisplayarm inconsistent with its own serialized form(
Decimal, for comparison, matches:decimal(p, s)in both). The likely origin wasa copy of the
decimal(...)paren style.This PR:
Displayarm tofixed[{size}];test_primitive_type_display, a table-driven test over everyPrimitiveTypevariant that pins all three directions —
Display,Serialize, andDeserialize— to the same canonical string, so this class of drift is caught infuture.
No behavioral impact on any wire/interop path: the serde (de)serialization was already
correct, and
Displayhas noFromStrcounterpart — its output is consumed only indiagnostic/error strings. This is purely a bug fix, not a format change to persisted data.
Are these changes tested?
Yes. New unit test
test_primitive_type_displayincrates/iceberg/src/spec/datatypes.rsasserts, for every primitive variant (includingFixed(4), theFixed(0)edge case, andDecimalboundary values):Displayemits the canonical string (fixed[4], notfixed(4));Serializeproduces the same string;Deserializeround-trips it back to the original type.The pre-existing
fixed(N)bug was invisible precisely because the serde path wasalready correct — no round-trip test exercised
Displaydirectly. This test closesthat gap. Verified locally:
cargo test -p iceberg spec::datatypes(12 pass),cargo fmt --check, andcargo clippyall clean.