sfc-gh-aloeser commented on code in PR #16972: URL: https://github.com/apache/iceberg/pull/16972#discussion_r4681850337
########## format/expressions-spec.md: ########## @@ -228,6 +228,15 @@ Note that `year`, `month`, and `hour` transforms produce ordinal values and not [bucket-ref]: spec.md#bucket-transform-details [truncate-ref]: spec.md#truncate-transform-details +### String functions + +Both functions produce `null` for a `null` or empty input value. + +| Function name | Description | Source types | Result type | +|-------------------------|------------------------------------------|--------------|-------------| +| `min_code_point(value)` | Smallest Unicode code point in the value | `string` | `int` | +| `max_code_point(value)` | Largest Unicode code point in the value | `string` | `int` | Review Comment: Some languages, such as Java, internally use UTF-16 to represent strings. Java's String does not compare by code points, but by UTF-16 code units. That matters because UTF-16 uses 2 UTF-16 code units (surrogates) to represent code points above U+FFFF. As a consequence, U+10000 < U+FFFF in Java - which contradicts, e.g., UTF-8 ordering (and code point ordering, too, imho). I think `Unicode code point` is the correct term to use here. It should be fine to leave it as is, but consider making it explicit -- 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]
