Skip to content

Spec: Clarify decimal type serialization#16798

Open
kevinjqliu wants to merge 1 commit into
apache:mainfrom
kevinjqliu:codex/spec-decimal-format
Open

Spec: Clarify decimal type serialization#16798
kevinjqliu wants to merge 1 commit into
apache:mainfrom
kevinjqliu:codex/spec-decimal-format

Conversation

@kevinjqliu

@kevinjqliu kevinjqliu commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Clarify canonical schema JSON decimal type strings as decimal(P, S), matching Java writer output via DecimalType.toString().
  • Document reader tolerance for optional whitespace in parameterized type strings, matching Java parser behavior.
  • Spec rendering: prevent code spans from wrapping in rendered docs tables.

Testing

  • git diff --check
  • Rendered spec page locally with site/make serve-dev

Before: https://iceberg.apache.org/spec/#primitive-types
decimal(P,S) and overflows on render
Screenshot 2026-06-13 at 2 00 31 PM

After: http://127.0.0.1:8000/spec/#primitive-types
decimal(P, S) and renders on same line
Screenshot 2026-06-13 at 2 00 15 PM

@github-actions github-actions Bot added the Specification Issues that may introduce spec changes. label Jun 13, 2026
@kevinjqliu kevinjqliu force-pushed the codex/spec-decimal-format branch 2 times, most recently from 47ac3b7 to cebc038 Compare June 13, 2026 20:11
@github-actions github-actions Bot added the docs label Jun 13, 2026
@kevinjqliu kevinjqliu force-pushed the codex/spec-decimal-format branch 2 times, most recently from 506217a to 3712561 Compare June 13, 2026 20:45
@kevinjqliu kevinjqliu force-pushed the codex/spec-decimal-format branch from 3712561 to f7164c5 Compare June 13, 2026 20:53
@kevinjqliu kevinjqliu changed the title Docs: Clarify decimal type serialization Spec: Clarify decimal type serialization Jun 13, 2026
font-family: "Source Sans Pro", sans-serif;
}

.md-typeset table code {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to properly render table cells on the same line, otherwise longer strings like "decimal(P,S)" might be split into multiple lines

Image

Comment thread format/spec.md
| | **`float`** | [32-bit IEEE 754](https://en.wikipedia.org/wiki/IEEE_754) floating point | Can promote to double |
| | **`double`** | [64-bit IEEE 754](https://en.wikipedia.org/wiki/IEEE_754) floating point | |
| | **`decimal(P,S)`** | Fixed-point decimal; precision P, scale S | Scale is fixed, precision must be 38 or less |
| | **`decimal(P, S)`** | Fixed-point decimal; precision P, scale S | Scale is fixed, precision must be 38 or less |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed all decimal(P,S) to decimal(P, S)

Comment thread format/spec.md
@@ -1679,14 +1675,16 @@

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed non-canonical example decimal(9,2)
and add a sentence below to explain that readers should accept from without space, decimal(9,2)

@huaxingao huaxingao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ebyhr ebyhr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the readability of the content has decreased. We need to scroll to view the example.

Before

Image

After

Image

Comment thread format/spec.md
| **`geometry(C)`** |`JSON string: "geometry(<C>)"`|`"geometry(srid:4326)"`|
| **`geography(C, A)`** |`JSON string: "geography(<C>,<E>)"`|`"geography(srid:4326,spherical)"`|

The schema JSON type strings in this table are the canonical serialized forms. Readers should accept optional whitespace around parameters and separators in parameterized type strings.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHOULD or MUST ?
what are the other lang implementations do ATM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Specification Issues that may introduce spec changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants