Skip to content

REST spec: Add create/drop/exists function endpoints to OpenAPI spec - #17966

Open
huaxingao wants to merge 1 commit into
apache:mainfrom
huaxingao:create_function_spec
Open

REST spec: Add create/drop/exists function endpoints to OpenAPI spec#17966
huaxingao wants to merge 1 commit into
apache:mainfrom
huaxingao:create_function_spec

Conversation

@huaxingao

Copy link
Copy Markdown
Contributor

Follow-up to #15180, which added listFunctions and loadFunction. This adds
the remaining function lifecycle operations that do not require a metadata
update model:

  • createFunction (POST .../functions)
  • dropFunction (DELETE .../functions/{function})
  • functionExists (HEAD .../functions/{function})

createFunction takes a new CreateFunctionRequest carrying the function name
and its definitions. The server assigns function-uuid, format-version and
definition-log, so those are not part of the request. It returns the loaded
function so clients do not need a follow-up load to learn the assigned UUID
and metadata location.

Errors use IcebergErrorResponse to match the existing function endpoints, and
a FunctionAlreadyExistsError example is added for the 409 case.

updateFunction is left for a follow-up, since committing changes to a function
requires a metadata update and requirement model that the UDF spec does not
define yet. Rename is also deferred: the function endpoints use
CatalogObjectIdentifier while RenameTableRequest uses TableIdentifier, and
which shape rename should use is worth settling separately.

204:
description: Success, no content
400:
description: Bad Request

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionExists declares no 403 while listFunctions, loadFunction, createFunction and dropFunction all do, and it leaves 400/401/404 as bare descriptions while $ref-ing the JSON-bodied 419/503/5XX responses in the same block. Mirror tableExists: $ref BadRequestErrorResponse, UnauthorizedResponse and ForbiddenResponse, and return IcebergErrorResponse with the NoSuchFunctionError example on 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants