WZhuo opened a new issue, #1142: URL: https://github.com/apache/iceberg-cpp/issues/1142
`ToJson` writes a decimal type as `"decimal(9,2)"`. The spec's Appendix C has used [`"decimal(<P>, <S>)"`](https://github.com/apache/iceberg/blob/1440e49e39a7c436a687b0289be067a5cf411e2c/format/spec.md#L2066), with `"decimal(9, 2)"` as the only example, since apache/iceberg#18145. Before that change, both spellings were listed. This makes two iceberg-verification fixtures fail on their `canonical` check (#909): [`types/primitive/decimal-9-2`](https://github.com/apache/iceberg-verification/blob/fb0be4d6cb2af5529a176b976b4a775dc87b778f/table-spec/types/primitive/cases.json#L157) and [`types/primitive/decimal-9-2-spaced`](https://github.com/apache/iceberg-verification/blob/fb0be4d6cb2af5529a176b976b4a775dc87b778f/table-spec/types/primitive/cases.json#L166). ``` canonical: expected "decimal(9, 2)", got "decimal(9,2)" ``` The no-space form comes from [`json_serde.cc`](https://github.com/apache/iceberg-cpp/blob/77fbd76e50dc8d5fb296bd8214a6fd7fe20627f7/src/iceberg/json_serde.cc#L666). [`DecimalType::ToString`](https://github.com/apache/iceberg-cpp/blob/77fbd76e50dc8d5fb296bd8214a6fd7fe20627f7/src/iceberg/type.cc#L311) and [Java](https://github.com/apache/iceberg/blob/1440e49e39a7c436a687b0289be067a5cf411e2c/api/src/main/java/org/apache/iceberg/types/Types.java#L549) already write `"decimal(9, 2)"`. `TypeFromJson` accepts both spellings, so changing the writer does not affect reading existing metadata. The round-trip case for `"decimal(10,2)"` in `schema_json_test.cc` would need its expected value updated. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
