functions
Creates, updates, deletes, gets or lists a functions
resource.
Overview
Name | functions |
Type | Resource |
Id | databricks_workspace.unitycatalog.functions |
Fields
The following fields are returned by SELECT
queries:
- get
- list
The function was successfully retrieved.
Name | Datatype | Description |
---|---|---|
name | string | |
function_id | string | |
metastore_id | string | |
catalog_name | string | |
external_name | string | |
full_name | string | |
schema_name | string | |
specific_name | string | |
browse_only | boolean | |
comment | string | |
created_at | integer | |
created_by | string | |
data_type | string | |
external_language | string | |
full_data_type | string | |
input_params | object | |
is_deterministic | boolean | |
is_null_call | boolean | |
owner | string | |
parameter_style | string | |
properties | string | |
return_params | object | |
routine_body | string | |
routine_definition | string | |
routine_dependencies | object | |
security_type | string | |
sql_data_access | string | |
sql_path | string | |
updated_at | integer | |
updated_by | string |
The function list was successfully retrieved.
Name | Datatype | Description |
---|---|---|
name | string | |
function_id | string | |
metastore_id | string | |
catalog_name | string | |
external_name | string | |
full_name | string | |
schema_name | string | |
specific_name | string | |
browse_only | boolean | |
comment | string | |
created_at | integer | |
created_by | string | |
data_type | string | |
external_language | string | |
full_data_type | string | |
input_params | object | |
is_deterministic | boolean | |
is_null_call | boolean | |
owner | string | |
parameter_style | string | |
properties | string | |
return_params | object | |
routine_body | string | |
routine_definition | string | |
routine_dependencies | object | |
security_type | string | |
sql_data_access | string | |
sql_path | string | |
updated_at | integer | |
updated_by | string |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | deployment_name | Gets a function from within a parent catalog and schema. For the fetch to succeed, the user must satisfy one of the following requirements: | |
list | select | deployment_name | 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 | |
create | insert | deployment_name | ||
update | update | deployment_name | 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. | |
delete | delete | deployment_name | Deletes 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.
Name | Datatype | Description |
---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT
examples
- get
- list
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;
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
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: functions
props:
- name: deployment_name
value: string
description: Required parameter for the functions resource.
- name: function_info
value: object
UPDATE
examples
- update
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
- delete
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;