szehon-ho commented on code in PR #18057: URL: https://github.com/apache/iceberg/pull/18057#discussion_r3993702423
########## format/udf-spec.md: ########## @@ -107,7 +107,11 @@ Notes: Types are based on the [Iceberg Type](https://iceberg.apache.org/spec/#schemas-and-data-types). Primitive and semi-structured type strings are encoded based on [Iceberg Type JSON Representation][iceberg-type-json] -(e.g., `int`, `string`, `timestamp`, `decimal(9,2)`, `variant`). Type strings must contain no spaces or quote characters. +(e.g., `int`, `string`, `timestamp`, `decimal(9, 2)`, `variant`). Type strings must contain no quote characters. + +Type strings are used exactly as Iceberg serializes them. Parameterized types may contain spaces, either separating +parameters (`decimal(9, 2)`, `geography(OGC:CRS84, spherical)`) or within a parameter value (`geometry(srid: 3857)`). +Readers must not add or remove spaces in a type string. Review Comment: Agree that write-side canonicalization should remain allowed. I think “compare exactly as written” is still too broad because Appendix C requires readers to accept optional whitespace around parameters and separators, so `decimal(9,2)` and `decimal(9, 2)` should resolve to the same type. Could we instead say: > Writers must use Iceberg’s canonical serialized form. Readers should accept optional whitespace around parameters and separators. Implementations must compare parsed or canonicalized types, not raw type strings. Canonicalization may normalize syntactic whitespace but must preserve whitespace within parameter values. This keeps `Types.fromTypeName(s).toString()` valid while preserving meaningful CRS whitespace such as in `srid: 3857`. -- 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]
