Alter function
PUT/metalakes/:metalake/catalogs/:catalog/schemas/:schema/functions/:function
Alter function
Request
Path Parameters
The name of the metalake
The name of the catalog
The name of the schema
The name of the function
- application/json
Body
Array [
- UpdateFunctionCommentRequest
- AddFunctionDefinitionRequest
- RemoveFunctionDefinitionRequest
- AddFunctionImplRequest
- UpdateFunctionImplRequest
- RemoveFunctionImplRequest
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
Array [
- SQLImpl
- JavaImpl
- PythonImpl
]
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
- SQLImpl
- JavaImpl
- PythonImpl
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
- SQLImpl
- JavaImpl
- PythonImpl
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
]
updates
object[]
required
oneOf
Possible values: [updateComment]
The new comment of the function. Can be null to clear the comment.
Possible values: [addDefinition]
definition
object
required
parameters
object[]
The parameters of the function definition
The name of the parameter
dataType
object
required
The data type of the parameter
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the parameter
defaultValue
object
The default value expression of the parameter
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
returnType
object
The return type of the function (for SCALAR and AGGREGATE functions)
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
returnColumns
object[]
nullable
The return columns of the function (for TABLE functions)
The name of the return column
dataType
object
required
The data type of the return column
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the return column
impls
object[]
The implementations of the function definition
oneOf
Possible values: [SQL]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The SQL expression
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [JAVA]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The fully qualified class name
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [PYTHON]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The Python handler function
The Python code block
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [removeDefinition]
parameters
object[]
required
The parameters that identify the definition to remove
The name of the parameter
dataType
object
required
The data type of the parameter
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the parameter
defaultValue
object
The default value expression of the parameter
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
Possible values: [addImpl]
parameters
object[]
required
The parameters that identify the target definition
The name of the parameter
dataType
object
required
The data type of the parameter
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the parameter
defaultValue
object
The default value expression of the parameter
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
implementation
object
required
A function implementation, discriminated by the language field
oneOf
Possible values: [SQL]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The SQL expression
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [JAVA]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The fully qualified class name
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [PYTHON]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The Python handler function
The Python code block
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [updateImpl]
parameters
object[]
required
The parameters that identify the target definition
The name of the parameter
dataType
object
required
The data type of the parameter
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the parameter
defaultValue
object
The default value expression of the parameter
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
Possible values: [SPARK, TRINO]
The runtime of the implementation to update
implementation
object
required
A function implementation, discriminated by the language field
oneOf
Possible values: [SQL]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The SQL expression
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [JAVA]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The fully qualified class name
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [PYTHON]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The Python handler function
The Python code block
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [removeImpl]
parameters
object[]
required
The parameters that identify the target definition
The name of the parameter
dataType
object
required
The data type of the parameter
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the parameter
defaultValue
object
The default value expression of the parameter
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
Possible values: [SPARK, TRINO]
The runtime of the implementation to remove
Responses
- 200
- 400
- 404
- 5xx
The response of function object
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- FunctionResponse
Schema
Array [
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
Array [
- SQLImpl
- JavaImpl
- PythonImpl
]
]
Possible values: [0]
Status code of the response
function
object
The name of the function
Possible values: [SCALAR, AGGREGATE, TABLE]
The type of the function
Whether the function is deterministic
The comment of the function
definitions
object[]
required
The definitions of the function
parameters
object[]
The parameters of the function definition
The name of the parameter
dataType
object
required
The data type of the parameter
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the parameter
defaultValue
object
The default value expression of the parameter
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
returnType
object
The return type of the function (for SCALAR and AGGREGATE functions)
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
returnColumns
object[]
nullable
The return columns of the function (for TABLE functions)
The name of the return column
dataType
object
required
The data type of the return column
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the return column
impls
object[]
The implementations of the function definition
oneOf
Possible values: [SQL]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The SQL expression
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [JAVA]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The fully qualified class name
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
Possible values: [PYTHON]
Possible values: [SPARK, TRINO]
The runtime type of the implementation
The Python handler function
The Python code block
resources
object
External resources required by a function implementation
JAR file URIs
File URIs
Archive URIs
properties
object
nullable
Additional properties
audit
object
required
Audit information for a Gravitino resource.
The user who created the resource
The time the resource was created
The user who last modified the resource
The time the resource was last modified
{
"code": 0,
"function": {
"name": "string",
"functionType": "SCALAR",
"deterministic": false,
"comment": "string",
"definitions": [
{
"parameters": [
{
"name": "string",
"dataType": [
"boolean",
"byte",
"byte unsigned",
"short",
"short unsigned",
"integer",
"integer unsigned",
"long",
"long unsigned",
"float",
"double",
"decimal(10,2)",
"date",
"time(3)",
"timestamp(3)",
"timestamp_tz(3)",
"string",
"char(10)",
"varchar(10)",
"interval_day",
"interval_year",
"uuid",
"fixed(16)",
"binary"
],
"comment": "string",
"defaultValue": {}
}
],
"returnType": [
"boolean",
"byte",
"byte unsigned",
"short",
"short unsigned",
"integer",
"integer unsigned",
"long",
"long unsigned",
"float",
"double",
"decimal(10,2)",
"date",
"time(3)",
"timestamp(3)",
"timestamp_tz(3)",
"string",
"char(10)",
"varchar(10)",
"interval_day",
"interval_year",
"uuid",
"fixed(16)",
"binary"
],
"returnColumns": [
{
"name": "string",
"dataType": [
"boolean",
"byte",
"byte unsigned",
"short",
"short unsigned",
"integer",
"integer unsigned",
"long",
"long unsigned",
"float",
"double",
"decimal(10,2)",
"date",
"time(3)",
"timestamp(3)",
"timestamp_tz(3)",
"string",
"char(10)",
"varchar(10)",
"interval_day",
"interval_year",
"uuid",
"fixed(16)",
"binary"
],
"comment": "string"
}
],
"impls": [
{},
{},
{}
]
}
],
"audit": {
"creator": "string",
"createTime": "2024-07-29T15:51:28.071Z",
"lastModifier": "string",
"lastModifiedTime": "2024-07-29T15:51:28.071Z"
}
}
}
{
"code": 0,
"function": {
"name": "add_one",
"functionType": "SCALAR",
"deterministic": true,
"comment": "A simple scalar function that adds one",
"definitions": [
{
"parameters": [
{
"name": "x",
"dataType": "integer"
}
],
"returnType": "integer",
"impls": [
{
"language": "SQL",
"runtime": "SPARK",
"sql": "x + 1"
}
]
}
],
"audit": {
"creator": "user1",
"createTime": "2021-01-01T00:00:00Z",
"lastModifier": "user1",
"lastModifiedTime": "2021-01-01T00:00:00Z"
}
}
}
Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"string"
]
}
{
"code": 1003,
"type": "BadRequestException",
"message": "Malformed request"
}
Not Found - The target function does not exist
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- NoSuchFunctionException
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"string"
]
}
{
"code": 1003,
"type": "NoSuchFunctionException",
"message": "Function does not exist",
"stack": [
"org.apache.gravitino.exceptions.NoSuchFunctionException: Function does not exist"
]
}
A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"string"
]
}
{
"code": 1002,
"type": "RuntimeException",
"message": "Internal Server Error",
"stack": [
"java.lang.RuntimeException: Internal Server Error"
]
}