rraulinio opened a new pull request, #1418:
URL: https://github.com/apache/iceberg-go/pull/1418

   ## Description
   
   Addressing part 1 from https://github.com/apache/iceberg-go/issues/1360.
   
   This adds a new `udf` package for Apache Iceberg SQL UDF metadata. The 
package models the UDF metadata JSON format from the Iceberg UDF spec: function 
UUID, format version, definitions, definition versions, `definition-log`, 
properties, secure flag, documentation, scalar UDFs and table UDFs. It includes 
parsing, JSON serialization, validation, semantic equality, cloning and a 
metadata builder for writers.
   
   Definitions are keyed by the canonical `definition-id` derived from 
parameter types, including nested list/map/struct signatures such as 
`int,list<int>,struct<id:int,name:string>`. UDF types are represented 
separately from schema types because UDF nested type JSON does not require 
field IDs, while iceberg-go schema parsing expects them. The parser accepts 
primitive type strings and the spec's nested type JSON objects, ignores extra 
nested-type fields as required by the spec and rejects nested canonical strings 
as metadata type encodings.
   
   The implementation validates the important spec invariants: required 
metadata fields, supported format version, one definition per signature, unique 
optional `specific-name`, valid function type, UDTF return type as a struct, 
non-empty definition versions, current version references, required 
`definition-log`, required representation fields, one SQL representation per 
dialect, supported `on-null-input` values and invalid nil/null or negative 
ID/timestamp cases. Unknown representation types are preserved for 
forward-compatible round-tripping when read from metadata, while writer-created 
unknown representations without raw JSON are rejected.
   
   This PR is intentionally limited to the metadata model. REST read-side 
support remains the next step from #1360.
   
   ## Tests
   
   - `go test ./udf`
   - `go test -race ./udf`
   - `go test ./...`
   - `go vet ./udf`
   


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