stevenzwu commented on code in PR #15180:
URL: https://github.com/apache/iceberg/pull/15180#discussion_r3018401664
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4184,6 +4300,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/UdfMetadata'
+
+ UdfMetadata:
Review Comment:
nit: `FunctionMetadata`?
similar comments for other usages of `Udf` in the spec.
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4184,6 +4300,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/UdfMetadata'
+
+ 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
+ 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/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.
Review Comment:
nit: maybe copy the description from the spec.
```
The definition-id is a canonical string derived from the parameter types,
formatted as a comma-separated list with no spaces.
```
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -5070,6 +5472,16 @@ components:
}
}
+ NoSuchFunctionError:
+ summary: The requested function does not exist
+ value: {
+ "error": {
+ "message": "The given function does not exist",
Review Comment:
nit: `given` -> `requested` to match the summary description
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4184,6 +4300,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/UdfMetadata'
+
+ 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
+ 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/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:
Review Comment:
When I think about a function/udf type, I think about the function signature
like name, parameters etc.
Is `FunctionDataType` or `UdfDataType` more accurate?
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4184,6 +4300,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/UdfMetadata'
+
+ 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
+ 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/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:
Review Comment:
the suggested name also matches the first a few words in the description :)
--
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]