huaxingao commented on code in PR #18057:
URL: https://github.com/apache/iceberg/pull/18057#discussion_r4138561162


##########
format/udf-spec.md:
##########
@@ -118,19 +122,26 @@ following fields required. Any other fields must be 
ignored.
   e.g., `{ "type": "struct", "fields": [ { "name": "id", "type": "int" }, { 
"name": "name", "type": "string" } ] }`
 
 #### Definition ID
-The `definition-id` is a canonical string derived from the parameter types, 
formatted as a comma-separated list with no
-spaces. Each type uses the following string representation:
+The `definition-id` is a canonical string derived from the parameter types, 
formatted as a comma-separated list. The
+separators that this format adds must not be followed by a space. Each type 
uses the following string representation:
 
 * Primitives and semi-structured: the type name (e.g., `int`, `variant`)
 * List: `list<element-type>` (e.g., `list<int>`)
 * Map: `map<key-type,value-type>` (e.g., `map<string,int>`)
 * Struct: `struct<name1:type1,name2:type2,...>` with field names and types 
(e.g., `struct<id:int,name:string>`)
 
+In a struct field name, `\`, `:`, `,`, `<`, and `>` must each be escaped with 
a preceding `\`. Without escaping, a
+field name that contains a separator would produce the same string as a 
different set of fields.
+
 Examples of complete definition-id signatures:
 
 * `int` – single int parameter
 * `int,string` – two parameters: int and string
 * `int,list<int>,struct<id:int,name:string>` – three parameters: an int, a 
list and a struct
+* `decimal(9, 2),geometry(srid: 3857)` – two parameterized parameters, each 
keeping its own spaces
+* `geometry(EPSG:4326)` – a geometry parameter with an explicit CRS
+* `geometry(OGC:CRS84)` – a geometry parameter declared as `geometry`, since 
canonical form always carries a CRS

Review Comment:
   I agree on `geometry(EPSG:4326)`. Line 141 already shows a CRS, so this one 
adds little. I'll drop it.
   
   I'd like to keep `geometry(OGC:CRS84)`. It is not about how geometry works. 
It shows what the derived string looks like when the user writes plain 
`geometry`: the id becomes `geometry(OGC:CRS84)`, because the canonical form 
always has a CRS. Without this example, someone would expect the id to say just 
`geometry`. 



-- 
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]

Reply via email to