Skip to main content

Function

View as Markdown

A user-defined function (UDF) registered in Unity Catalog. A function belongs to a schema and is referenced as catalog_name.schema_name.function_name. Its body is either a SQL expression or query, or source code in an external language such as Python. See https://docs.databricks.com/aws/en/udf/unity-catalog for an overview.

FunctionInfo object​

A user-defined function (UDF) registered in Unity Catalog. A function belongs to a schema and is referenced as catalog_name.schema_name.function_name. Its body is either a SQL expression or query, or source code in an external language such as Python. See https://docs.databricks.com/aws/en/udf/unity-catalog for an overview.

namestring

Name of function, relative to parent schema.

catalog_namestring

Name of parent Catalog.

schema_namestring

Name of parent Schema relative to its parent Catalog.

input_paramsobject

Input parameters of the function. When it is set, parameters must contain at least one entry. A function that takes no arguments omits input_params, even though the Create request schema marks it as required.

Show child attributesHide child attributes
parametersarray of object

The parameters that make up the list, ordered by position.

Show child attributesHide child attributes
namestring

Name of Parameter.

type_textstring

Data type of the parameter in SQL syntax, including any type parameters such as precision and scale.

type_jsonstring

Data type of the parameter as the JSON representation of a Spark SQL struct field, with name, type, nullable and metadata keys.

type_namestring

Name of type (INT, STRUCT, MAP, etc.)

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
type_precisionint32

Digits of precision; required on Create for DecimalTypes.

type_scaleint32

Digits to right of decimal; Required on Create for DecimalTypes.

type_interval_typestring

Unit range of the data type for INTERVAL parameters. It is unset for other types.

positionint32

Zero-based position of the parameter in the parameter list. Positions must be unique and consecutive.

parameter_modestring

Direction of the parameter. Only IN parameters, which pass a value into the function, are supported.

Values:

  • IN
parameter_typestring

Whether the entry is an input parameter (PARAM) or a result column of a table function (COLUMN).

Values:

  • PARAM
  • COLUMN
parameter_defaultstring

Default value of the parameter as a SQL expression, used when a call omits the argument.

commentstring

User-provided free-form text description.

data_typestring

Data type of the value the function returns. A table function uses TABLE_TYPE and describes its result columns in return_params, except for a polymorphic Python UDTF, which omits them.

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
full_data_typestring

Return data type of the function in SQL syntax, including any type parameters such as precision and scale.

routine_bodystring

Language of the function body. SQL means that routine_definition holds a SQL expression or query. EXTERNAL means that it holds source code in the language named by external_language, and sql_data_access must then be NO_SQL.

Values:

  • SQL
  • EXTERNAL
routine_definitionstring

Body of the function. For a SQL function it is the expression or query that computes the result; for an EXTERNAL function it is the source code of the function. It is omitted when the caller can only browse the function.

parameter_stylestring

How arguments are passed to the function body. S means that each argument is passed as a single scalar value.

Values:

  • S
is_deterministicboolean

Whether the function returns the same result for the same arguments. It corresponds to the DETERMINISTIC characteristic of CREATE FUNCTION.

sql_data_accessstring

How the function body interacts with SQL data. CONTAINS_SQL means that the body contains SQL but reads no table or view, READS_SQL_DATA means that it reads a table or view, and NO_SQL is required for EXTERNAL functions.

Values:

  • CONTAINS_SQL
  • READS_SQL_DATA
  • NO_SQL
is_null_callboolean

Whether the function is a null-call function in the sense of the SQL standard, which returns NULL whenever any argument is NULL.

security_typestring

Whose privileges the function body runs with. DEFINER runs it with the privileges of the function owner.

Values:

  • DEFINER
specific_namestring

Specific name of the function. Set it to the same value as name.

return_paramsobject

Result columns of a table function. Set it when data_type is TABLE_TYPE, except for a polymorphic Python UDTF (an EXTERNAL Python function with full_data_type "()"), which must not set it.

Show child attributesHide child attributes
parametersarray of object

The parameters that make up the list, ordered by position.

Show child attributesHide child attributes
namestring

Name of Parameter.

type_textstring

Data type of the parameter in SQL syntax, including any type parameters such as precision and scale.

type_jsonstring

Data type of the parameter as the JSON representation of a Spark SQL struct field, with name, type, nullable and metadata keys.

type_namestring

Name of type (INT, STRUCT, MAP, etc.)

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
type_precisionint32

Digits of precision; required on Create for DecimalTypes.

type_scaleint32

Digits to right of decimal; Required on Create for DecimalTypes.

type_interval_typestring

Unit range of the data type for INTERVAL parameters. It is unset for other types.

positionint32

Zero-based position of the parameter in the parameter list. Positions must be unique and consecutive.

parameter_modestring

Direction of the parameter. Only IN parameters, which pass a value into the function, are supported.

Values:

  • IN
parameter_typestring

Whether the entry is an input parameter (PARAM) or a result column of a table function (COLUMN).

Values:

  • PARAM
  • COLUMN
parameter_defaultstring

Default value of the parameter as a SQL expression, used when a call omits the argument.

commentstring

User-provided free-form text description.

external_namestring

Name of the function in its external language. It is reserved for future use.

external_languagestring

Language of the function body for an EXTERNAL function. It is required when routine_body is EXTERNAL.

Example: Python

sql_pathstring

List of schemas whose objects can be referenced without qualification.

ownerstring

Username of current owner of the function.

commentstring

User-provided free-form text description.

propertiesstring

JSON-serialized key-value pair map, encoded (escaped) as a string.

routine_dependenciesobject

Function dependencies. For external UDFs, dependencies may contain only credential, secret, or volume objects.

Show child attributesHide child attributes
dependenciesarray of object

Array of dependencies.

Show child attributesHide child attributes
tableobject
Show child attributesHide child attributes
table_full_namestring

Full name of the dependent table, in the form of catalog_name.schema_name.table_name.

functionobject
Show child attributesHide child attributes
function_full_namestring

Full name of the dependent function, in the form of catalog_name.schema_name.function_name.

connectionobject
Show child attributesHide child attributes
connection_namestring

Full name of the dependent connection, in the form of connection_name.

credentialobject
Show child attributesHide child attributes
credential_namestring

Full name of the dependent credential, in the form of credential_name.

metastore_idstring

Unique identifier of parent metastore.

full_namestring

Full name of Function, in form of catalog_name.schema_name.function_name

created_atint64

Time at which this function was created, in epoch milliseconds.

created_bystring

Username of function creator.

updated_atint64

Time at which this function was last modified, in epoch milliseconds.

updated_bystring

Username of user who last modified the function.

function_idstring

Id of Function, relative to parent schema.

browse_onlyboolean

Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.

Get a function GA​

GET /api/2.1/unity-catalog/functions/{full_name_arg}

Gets a function from within a parent catalog and schema. For the fetch to succeed, the user must satisfy one of the following requirements:

  • Is a metastore admin
  • Is an owner of the function's parent catalog
  • Have the USE_CATALOG privilege on the function's parent catalog and be the owner of the function
  • Have the USE_CATALOG privilege on the function's parent catalog, the USE_SCHEMA privilege on the function's parent schema, and the EXECUTE privilege on the function itself

API scopes: unity-catalog

Parameters​

full_name_argstringRequiredpath

The fully-qualified name of the function (of the form catalog_name.schema_name.function_name).

include_browsebooleanquery

Whether to include functions in the response for which the principal can only access selective metadata for

Response​

Returns the FunctionInfo object.

List functions GA​

GET /api/2.1/unity-catalog/functions

List functions within the specified parent catalog and schema. If the user is a metastore admin, all functions are returned in the output list. Otherwise, the user must have the USE_CATALOG privilege on the catalog and the USE_SCHEMA privilege on the schema, and the output list contains only functions for which either the user has the EXECUTE privilege or the user is the owner. There is no guarantee of a specific ordering of the elements in the array.

NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.

PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.

API scopes: unity-catalog

Parameters​

catalog_namestringRequiredquery

Name of parent catalog for functions of interest.

schema_namestringRequiredquery

Parent schema of functions.

include_browsebooleanquery

Whether to include functions in the response for which the principal can only access selective metadata for

max_resultsint32<= 1000query

Maximum number of functions to return. If not set, all the functions are returned (not recommended).

  • when set to a value greater than 0, the page length is the minimum of this value and a server configured value;
  • when set to 0, the page length is set to a server configured value (recommended);
  • when set to a value less than 0, an invalid parameter error is returned;
page_tokenstringquery

Opaque pagination token to go to next page based on previous query.

Response​

Returns a list of FunctionInfo objects.

Create a function GA​

POST /api/2.1/unity-catalog/functions

WARNING: This API is experimental and will change in future versions

Creates a new function

The user must have the following permissions in order for the function to be created:

  • USE_CATALOG on the function's parent catalog
  • USE_SCHEMA and CREATE_FUNCTION on the function's parent schema

API scopes: unity-catalog

Request body​

function_infoobjectRequired

Partial FunctionInfo specifying the function to be created.

Show child attributesHide child attributes
namestring

Name of function, relative to parent schema.

catalog_namestring

Name of parent Catalog.

schema_namestring

Name of parent Schema relative to its parent Catalog.

input_paramsobject

Input parameters of the function. When it is set, parameters must contain at least one entry. A function that takes no arguments omits input_params, even though the Create request schema marks it as required.

Show child attributesHide child attributes
parametersarray of object

The parameters that make up the list, ordered by position.

Show child attributesHide child attributes
namestringRequired

Name of Parameter.

type_textstringRequired

Data type of the parameter in SQL syntax, including any type parameters such as precision and scale.

type_jsonstring

Data type of the parameter as the JSON representation of a Spark SQL struct field, with name, type, nullable and metadata keys.

type_namestringRequired

Name of type (INT, STRUCT, MAP, etc.)

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
type_precisionint32

Digits of precision; required on Create for DecimalTypes.

type_scaleint32

Digits to right of decimal; Required on Create for DecimalTypes.

type_interval_typestring

Unit range of the data type for INTERVAL parameters. It is unset for other types.

positionint32Required

Zero-based position of the parameter in the parameter list. Positions must be unique and consecutive.

parameter_modestring

Direction of the parameter. Only IN parameters, which pass a value into the function, are supported.

Values:

  • IN
parameter_typestring

Whether the entry is an input parameter (PARAM) or a result column of a table function (COLUMN).

Values:

  • PARAM
  • COLUMN
parameter_defaultstring

Default value of the parameter as a SQL expression, used when a call omits the argument.

commentstring

User-provided free-form text description.

data_typestring

Data type of the value the function returns. A table function uses TABLE_TYPE and describes its result columns in return_params, except for a polymorphic Python UDTF, which omits them.

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
full_data_typestring

Return data type of the function in SQL syntax, including any type parameters such as precision and scale.

routine_bodystring

Language of the function body. SQL means that routine_definition holds a SQL expression or query. EXTERNAL means that it holds source code in the language named by external_language, and sql_data_access must then be NO_SQL.

Values:

  • SQL
  • EXTERNAL
routine_definitionstring

Body of the function. For a SQL function it is the expression or query that computes the result; for an EXTERNAL function it is the source code of the function. It is omitted when the caller can only browse the function.

parameter_stylestring

How arguments are passed to the function body. S means that each argument is passed as a single scalar value.

Values:

  • S
is_deterministicboolean

Whether the function returns the same result for the same arguments. It corresponds to the DETERMINISTIC characteristic of CREATE FUNCTION.

sql_data_accessstring

How the function body interacts with SQL data. CONTAINS_SQL means that the body contains SQL but reads no table or view, READS_SQL_DATA means that it reads a table or view, and NO_SQL is required for EXTERNAL functions.

Values:

  • CONTAINS_SQL
  • READS_SQL_DATA
  • NO_SQL
is_null_callboolean

Whether the function is a null-call function in the sense of the SQL standard, which returns NULL whenever any argument is NULL.

security_typestring

Whose privileges the function body runs with. DEFINER runs it with the privileges of the function owner.

Values:

  • DEFINER
specific_namestring

Specific name of the function. Set it to the same value as name.

return_paramsobject

Result columns of a table function. Set it when data_type is TABLE_TYPE, except for a polymorphic Python UDTF (an EXTERNAL Python function with full_data_type "()"), which must not set it.

Show child attributesHide child attributes
parametersarray of object

The parameters that make up the list, ordered by position.

Show child attributesHide child attributes
namestringRequired

Name of Parameter.

type_textstringRequired

Data type of the parameter in SQL syntax, including any type parameters such as precision and scale.

type_jsonstring

Data type of the parameter as the JSON representation of a Spark SQL struct field, with name, type, nullable and metadata keys.

type_namestringRequired

Name of type (INT, STRUCT, MAP, etc.)

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
type_precisionint32

Digits of precision; required on Create for DecimalTypes.

type_scaleint32

Digits to right of decimal; Required on Create for DecimalTypes.

type_interval_typestring

Unit range of the data type for INTERVAL parameters. It is unset for other types.

positionint32Required

Zero-based position of the parameter in the parameter list. Positions must be unique and consecutive.

parameter_modestring

Direction of the parameter. Only IN parameters, which pass a value into the function, are supported.

Values:

  • IN
parameter_typestring

Whether the entry is an input parameter (PARAM) or a result column of a table function (COLUMN).

Values:

  • PARAM
  • COLUMN
parameter_defaultstring

Default value of the parameter as a SQL expression, used when a call omits the argument.

commentstring

User-provided free-form text description.

external_namestring

Name of the function in its external language. It is reserved for future use.

external_languagestring

Language of the function body for an EXTERNAL function. It is required when routine_body is EXTERNAL.

Example: Python

sql_pathstring

List of schemas whose objects can be referenced without qualification.

ownerstring

Username of current owner of the function.

commentstring

User-provided free-form text description.

propertiesstring

JSON-serialized key-value pair map, encoded (escaped) as a string.

routine_dependenciesobject

Function dependencies. For external UDFs, dependencies may contain only credential, secret, or volume objects.

Show child attributesHide child attributes
dependenciesarray of object

Array of dependencies.

Show child attributesHide child attributes
tableobject
Show child attributesHide child attributes
table_full_namestringRequired

Full name of the dependent table, in the form of catalog_name.schema_name.table_name.

functionobject
Show child attributesHide child attributes
function_full_namestringRequired

Full name of the dependent function, in the form of catalog_name.schema_name.function_name.

connectionobject
Show child attributesHide child attributes
connection_namestring

Full name of the dependent connection, in the form of connection_name.

credentialobject
Show child attributesHide child attributes
credential_namestring

Full name of the dependent credential, in the form of credential_name.

metastore_idstring

Unique identifier of parent metastore.

full_namestring

Full name of Function, in form of catalog_name.schema_name.function_name

created_atint64

Time at which this function was created, in epoch milliseconds.

created_bystring

Username of function creator.

updated_atint64

Time at which this function was last modified, in epoch milliseconds.

updated_bystring

Username of user who last modified the function.

function_idstring

Id of Function, relative to parent schema.

browse_onlyboolean

Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.

Response​

Returns the FunctionInfo object.

Update a function GA​

PATCH /api/2.1/unity-catalog/functions/{full_name_arg}

Updates the function that matches the supplied name. Only the owner of the function can be updated. If the user is not a metastore admin, the user must be a member of the group that is the new function owner.

  • Is a metastore admin
  • Is the owner of the function's parent catalog
  • Is the owner of the function's parent schema and has the USE_CATALOG privilege on its parent catalog
  • Is the owner of the function itself and has the USE_CATALOG privilege on its parent catalog as well as the USE_SCHEMA privilege on the function's parent schema.

API scopes: unity-catalog

Parameters​

full_name_argstringRequiredpath

The fully-qualified name of the function (of the form catalog_name.schema_name.function_name).

Request body​

namestring

Name of function, relative to parent schema.

catalog_namestring

Name of parent Catalog.

schema_namestring

Name of parent Schema relative to its parent Catalog.

input_paramsobject

Input parameters of the function. When it is set, parameters must contain at least one entry. A function that takes no arguments omits input_params, even though the Create request schema marks it as required.

Show child attributesHide child attributes
parametersarray of object

The parameters that make up the list, ordered by position.

Show child attributesHide child attributes
namestringRequired

Name of Parameter.

type_textstringRequired

Data type of the parameter in SQL syntax, including any type parameters such as precision and scale.

type_jsonstring

Data type of the parameter as the JSON representation of a Spark SQL struct field, with name, type, nullable and metadata keys.

type_namestringRequired

Name of type (INT, STRUCT, MAP, etc.)

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
type_precisionint32

Digits of precision; required on Create for DecimalTypes.

type_scaleint32

Digits to right of decimal; Required on Create for DecimalTypes.

type_interval_typestring

Unit range of the data type for INTERVAL parameters. It is unset for other types.

positionint32Required

Zero-based position of the parameter in the parameter list. Positions must be unique and consecutive.

parameter_modestring

Direction of the parameter. Only IN parameters, which pass a value into the function, are supported.

Values:

  • IN
parameter_typestring

Whether the entry is an input parameter (PARAM) or a result column of a table function (COLUMN).

Values:

  • PARAM
  • COLUMN
parameter_defaultstring

Default value of the parameter as a SQL expression, used when a call omits the argument.

commentstring

User-provided free-form text description.

data_typestring

Data type of the value the function returns. A table function uses TABLE_TYPE and describes its result columns in return_params, except for a polymorphic Python UDTF, which omits them.

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
full_data_typestring

Return data type of the function in SQL syntax, including any type parameters such as precision and scale.

routine_bodystring

Language of the function body. SQL means that routine_definition holds a SQL expression or query. EXTERNAL means that it holds source code in the language named by external_language, and sql_data_access must then be NO_SQL.

Values:

  • SQL
  • EXTERNAL
routine_definitionstring

Body of the function. For a SQL function it is the expression or query that computes the result; for an EXTERNAL function it is the source code of the function. It is omitted when the caller can only browse the function.

parameter_stylestring

How arguments are passed to the function body. S means that each argument is passed as a single scalar value.

Values:

  • S
is_deterministicboolean

Whether the function returns the same result for the same arguments. It corresponds to the DETERMINISTIC characteristic of CREATE FUNCTION.

sql_data_accessstring

How the function body interacts with SQL data. CONTAINS_SQL means that the body contains SQL but reads no table or view, READS_SQL_DATA means that it reads a table or view, and NO_SQL is required for EXTERNAL functions.

Values:

  • CONTAINS_SQL
  • READS_SQL_DATA
  • NO_SQL
is_null_callboolean

Whether the function is a null-call function in the sense of the SQL standard, which returns NULL whenever any argument is NULL.

security_typestring

Whose privileges the function body runs with. DEFINER runs it with the privileges of the function owner.

Values:

  • DEFINER
specific_namestring

Specific name of the function. Set it to the same value as name.

return_paramsobject

Result columns of a table function. Set it when data_type is TABLE_TYPE, except for a polymorphic Python UDTF (an EXTERNAL Python function with full_data_type "()"), which must not set it.

Show child attributesHide child attributes
parametersarray of object

The parameters that make up the list, ordered by position.

Show child attributesHide child attributes
namestringRequired

Name of Parameter.

type_textstringRequired

Data type of the parameter in SQL syntax, including any type parameters such as precision and scale.

type_jsonstring

Data type of the parameter as the JSON representation of a Spark SQL struct field, with name, type, nullable and metadata keys.

type_namestringRequired

Name of type (INT, STRUCT, MAP, etc.)

Values:

Show 24 possible values
  • BOOLEAN
  • BYTE
  • SHORT
  • INT
  • LONG
  • FLOAT
  • DOUBLE
  • DATE
  • TIMESTAMP
  • STRING
  • BINARY
  • DECIMAL
  • INTERVAL
  • ARRAY
  • STRUCT
  • MAP
  • CHAR
  • NULL
  • USER_DEFINED_TYPE
  • TIMESTAMP_NTZ
  • VARIANT
  • GEOMETRY
  • GEOGRAPHY
  • TABLE_TYPE
type_precisionint32

Digits of precision; required on Create for DecimalTypes.

type_scaleint32

Digits to right of decimal; Required on Create for DecimalTypes.

type_interval_typestring

Unit range of the data type for INTERVAL parameters. It is unset for other types.

positionint32Required

Zero-based position of the parameter in the parameter list. Positions must be unique and consecutive.

parameter_modestring

Direction of the parameter. Only IN parameters, which pass a value into the function, are supported.

Values:

  • IN
parameter_typestring

Whether the entry is an input parameter (PARAM) or a result column of a table function (COLUMN).

Values:

  • PARAM
  • COLUMN
parameter_defaultstring

Default value of the parameter as a SQL expression, used when a call omits the argument.

commentstring

User-provided free-form text description.

external_namestring

Name of the function in its external language. It is reserved for future use.

external_languagestring

Language of the function body for an EXTERNAL function. It is required when routine_body is EXTERNAL.

Example: Python

sql_pathstring

List of schemas whose objects can be referenced without qualification.

ownerstring

Username of current owner of the function.

commentstring

User-provided free-form text description.

propertiesstring

JSON-serialized key-value pair map, encoded (escaped) as a string.

routine_dependenciesobject

Function dependencies. For external UDFs, dependencies may contain only credential, secret, or volume objects.

Show child attributesHide child attributes
dependenciesarray of object

Array of dependencies.

Show child attributesHide child attributes
tableobject
Show child attributesHide child attributes
table_full_namestringRequired

Full name of the dependent table, in the form of catalog_name.schema_name.table_name.

functionobject
Show child attributesHide child attributes
function_full_namestringRequired

Full name of the dependent function, in the form of catalog_name.schema_name.function_name.

connectionobject
Show child attributesHide child attributes
connection_namestring

Full name of the dependent connection, in the form of connection_name.

credentialobject
Show child attributesHide child attributes
credential_namestring

Full name of the dependent credential, in the form of credential_name.

metastore_idstring

Unique identifier of parent metastore.

full_namestring

Full name of Function, in form of catalog_name.schema_name.function_name

created_atint64

Time at which this function was created, in epoch milliseconds.

created_bystring

Username of function creator.

updated_atint64

Time at which this function was last modified, in epoch milliseconds.

updated_bystring

Username of user who last modified the function.

function_idstring

Id of Function, relative to parent schema.

browse_onlyboolean

Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.

Response​

Returns the FunctionInfo object.

Delete a function GA​

DELETE /api/2.1/unity-catalog/functions/{full_name_arg}

Deletes the function that matches the supplied name. For the deletion to succeed, the user must satisfy one of the following conditions:

  • Is the owner of the function's parent catalog
  • Is the owner of the function's parent schema and have the USE_CATALOG privilege on its parent catalog
  • Is the owner of the function itself and have both the USE_CATALOG privilege on its parent catalog and the USE_SCHEMA privilege on its parent schema

API scopes: unity-catalog

Parameters​

full_name_argstringRequiredpath

The fully-qualified name of the function (of the form catalog_name.schema_name.function_name).

forcebooleanquery

Force deletion even if the function is not empty.