danielcweeks commented on code in PR #15180:
URL: https://github.com/apache/iceberg/pull/15180#discussion_r2927819497


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4181,6 +4255,223 @@ components:
           items:
             $ref: '#/components/schemas/Namespace'
 
+    LoadFunctionResult:
+      description: |
+        Result returned when a function is loaded from the catalog.
+
+
+        The function metadata JSON is returned in the `metadata` field. The 
location of the metadata
+        file is returned in the `metadata-location` field.
+
+
+        The `config` map returns function-specific configuration for accessing 
the function's resources,
+        including any required credentials or client configuration overrides.
+      type: object
+      required:
+        - metadata-location
+        - metadata
+      properties:
+        metadata-location:
+          type: string
+        metadata:
+          $ref: '#/components/schemas/UdfMetadata'
+        config:
+          type: object
+          additionalProperties:
+            type: string
+
+    UdfMetadata:
+      description: |
+        Portable UDF metadata format.
+
+
+        Each function is represented by a self-contained metadata file. The 
`format-version` field
+        identifies the UDF metadata format.
+      type: object
+      required:
+        - function-uuid
+        - format-version
+        - definitions
+        - definition-log
+      properties:
+        function-uuid:
+          type: string
+          description: A UUID that identifies this UDF, generated once at 
creation.
+        format-version:
+          type: integer
+          description: UDF specification format version (must be 1).
+          enum: [1]
+        definitions:
+          type: array
+          description: List of function definition entities.
+          items:
+            $ref: '#/components/schemas/UdfDefinition'
+        definition-log:
+          type: array
+          description: History of versions within the function's definitions.
+          items:
+            $ref: '#/components/schemas/UdfDefinitionLogEntry'
+        location:
+          type: string
+          description: The function's base location; used to create metadata 
file locations.
+        properties:
+          type: object
+          description: A string-to-string map of properties.
+          additionalProperties:
+            type: string
+        secure:
+          type: boolean
+          description: Whether it is a secure function.
+          default: false
+        doc:
+          type: string
+          description: Documentation string.
+
+    UdfDefinition:
+      type: object
+      required:
+        - definition-id
+        - parameters
+        - return-type
+        - versions
+        - current-version-id
+        - function-type
+      properties:
+        definition-id:
+          type: string
+          description: An identifier derived from the canonical parameter-type 
tuple.
+        parameters:
+          type: array
+          description: Ordered list of function parameters. Invocation order 
must match this list.
+          items:
+            $ref: '#/components/schemas/UdfParameter'
+        return-type:
+          $ref: '#/components/schemas/UdfType'
+        return-nullable:
+          type: boolean
+          description: A hint to indicate whether the return value is nullable 
or not.
+          default: true
+        versions:
+          type: array
+          description: Versioned implementations of this definition.
+          items:
+            $ref: '#/components/schemas/UdfDefinitionVersion'
+        current-version-id:
+          type: integer
+          description: Identifier of the current version for this definition.
+        function-type:
+          type: string
+          description: Function type.
+          enum: ["udf", "udtf"]
+        doc:
+          type: string
+          description: Documentation string.
+
+    UdfParameter:
+      type: object
+      required:
+        - type
+        - name
+      properties:
+        type:
+          $ref: '#/components/schemas/UdfType'
+        name:
+          type: string
+        doc:
+          type: string
+          description: Parameter documentation.
+
+    UdfType:
+      description: >
+        A UDF data type, encoded either as a type string (e.g., "int", 
"decimal(9,2)") or as a JSON
+        object for nested types (struct, list, map) following the UDF spec 
Types section.
+
+
+        Nested types are based on the Iceberg type JSON representation, but 
the UDF spec only
+        requires a subset of fields (e.g., list requires `type` and `element`; 
map requires `type`,
+        `key`, and `value`; struct requires `type` and `fields`). Any other 
fields must be ignored.
+      oneOf:
+        - type: string
+        - type: object

Review Comment:
   This feels very much underspecified.  How much work would it really be to 
fully define this for structured types?



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