Skip to main content

functions

Creates, updates, deletes, gets or lists a functions resource.

Overview

Namefunctions
TypeResource
Iddatabricks_workspace.unitycatalog.functions

Fields

The following fields are returned by SELECT queries:

The function was successfully retrieved.

NameDatatypeDescription
namestring
function_idstring
metastore_idstring
catalog_namestring
external_namestring
full_namestring
schema_namestring
specific_namestring
browse_onlyboolean
commentstring
created_atinteger
created_bystring
data_typestring
external_languagestring
full_data_typestring
input_paramsobject
is_deterministicboolean
is_null_callboolean
ownerstring
parameter_stylestring
propertiesstring
return_paramsobject
routine_bodystring
routine_definitionstring
routine_dependenciesobject
security_typestring
sql_data_accessstring
sql_pathstring
updated_atinteger
updated_bystring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets a function from within a parent catalog and schema. For the fetch to succeed, the user must satisfy one of the following requirements:
listselectdeployment_nameList 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
createinsertdeployment_name
updateupdatedeployment_nameUpdates 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.
deletedeletedeployment_nameDeletes the function that matches the supplied name. For the deletion to succeed, the user must satisfy one of the following conditions:

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

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

SELECT
name,
function_id,
metastore_id,
catalog_name,
external_name,
full_name,
schema_name,
specific_name,
browse_only,
comment,
created_at,
created_by,
data_type,
external_language,
full_data_type,
input_params,
is_deterministic,
is_null_call,
owner,
parameter_style,
properties,
return_params,
routine_body,
routine_definition,
routine_dependencies,
security_type,
sql_data_access,
sql_path,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.functions
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

No description available.

INSERT INTO databricks_workspace.unitycatalog.functions (
data__function_info,
deployment_name
)
SELECT
'{{ function_info }}',
'{{ deployment_name }}'
RETURNING
name,
function_id,
metastore_id,
catalog_name,
external_name,
full_name,
schema_name,
specific_name,
browse_only,
comment,
created_at,
created_by,
data_type,
external_language,
full_data_type,
input_params,
is_deterministic,
is_null_call,
owner,
parameter_style,
properties,
return_params,
routine_body,
routine_definition,
routine_dependencies,
security_type,
sql_data_access,
sql_path,
updated_at,
updated_by
;

UPDATE examples

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.

UPDATE databricks_workspace.unitycatalog.functions
SET
data__owner = '{{ owner }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
function_id,
metastore_id,
catalog_name,
external_name,
full_name,
schema_name,
specific_name,
browse_only,
comment,
created_at,
created_by,
data_type,
external_language,
full_data_type,
input_params,
is_deterministic,
is_null_call,
owner,
parameter_style,
properties,
return_params,
routine_body,
routine_definition,
routine_dependencies,
security_type,
sql_data_access,
sql_path,
updated_at,
updated_by;

DELETE examples

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

DELETE FROM databricks_workspace.unitycatalog.functions
WHERE deployment_name = '{{ deployment_name }}' --required;