stevenzwu commented on code in PR #15180:
URL: https://github.com/apache/iceberg/pull/15180#discussion_r3319829896
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4307,6 +4410,278 @@ 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, if available.
+ type: object
+ required:
+ - metadata
+ properties:
+ metadata-location:
+ type: string
+ metadata:
+ $ref: '#/components/schemas/FunctionMetadata'
+
+ FunctionMetadata:
+ 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
+ format: uuid
+ 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]
Review Comment:
nit: `enum: [1]` is functionally equivalent to but stylistically
inconsistent with `TableMetadata.format-version` (`minimum: 1, maximum: 3`) and
`ViewMetadata.format-version` (`minimum: 1, maximum: 1`). `minimum: 1, maximum:
1` keeps the pattern uniform across the three metadata schemas.
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -5204,6 +5598,21 @@ components:
]
}
+ ListFunctionsEmptyExample:
+ summary: An empty list for a namespace with no functions
+ value: {
+ "identifiers": [ ]
+ }
+
+ ListFunctionsNonEmptyExample:
+ summary: A non-empty list of function identifiers
+ value: {
+ "identifiers": [
+ { "namespace": ["analytics"], "name": "add_one" },
Review Comment:
The schema for `ListFunctionsResponse.identifiers` items references
`CatalogObjectIdentifier`, which is defined as `type: array` of strings (e.g.
`["accounting", "tax", "paid"]`).
We should rewrite the example to match `CatalogObjectIdentifier`: `{
"identifiers": [["analytics", "add_one"], ["analytics", "to_celsius"]] }`.
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4307,6 +4410,278 @@ 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, if available.
+ type: object
+ required:
+ - metadata
+ properties:
+ metadata-location:
+ type: string
+ metadata:
+ $ref: '#/components/schemas/FunctionMetadata'
+
+ FunctionMetadata:
+ 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
+ format: uuid
+ 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/FunctionDefinition'
+ definition-log:
+ type: array
+ description: History of versions within the function's definitions.
+ items:
+ $ref: '#/components/schemas/FunctionDefinitionLogEntry'
+ location:
+ type: string
+ description: The function's base location. This is used to store
function metadata files.
+ 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.
+
+ FunctionDefinition:
+ type: object
+ required:
+ - definition-id
+ - parameters
+ - return-type
+ - versions
+ - current-version-id
+ - function-type
+ properties:
+ definition-id:
+ type: string
+ description: A canonical string derived from the parameter types,
formatted as a comma-separated list with no spaces.
+ parameters:
+ type: array
+ description: Ordered list of function parameters. Invocation order
must match this list.
+ items:
+ $ref: '#/components/schemas/FunctionParameter'
+ return-type:
+ $ref: '#/components/schemas/FunctionDataType'
+ 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/FunctionDefinitionVersion'
+ current-version-id:
+ type: integer
+ description: Identifier of the current version for this definition.
+ function-type:
Review Comment:
Constraint from the UDF spec is not captured here: *"If `udtf`,
`return-type` must be a struct describing the output schema."* And `Function
type.` alone is uninformative. Suggested:
```yaml
description: Function type. When set to "udtf", "return-type" must be a
struct describing the output schema.
```
--
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]