unitycatalog.functions¶
The classes of the functions API.
Classes
| Name | Description |
|---|---|
CreateFunction |
The function to create. |
FunctionClient |
The requests on one FunctionInfo. |
FunctionInfo |
A function: a user-defined function in the third layer of the three-level namespace, below a schema. |
FunctionParameterInfo |
A parameter or result column of a function. |
FunctionParameterInfos |
The parameters of a function. |
ListFunctionsResponse |
Enums
| Name | Description |
|---|---|
FunctionParameterMode |
The mode of a function parameter. |
FunctionParameterType |
The kind of a function parameter. |
ParameterStyle |
The parameter style of a function. |
RoutineBody |
The language of the body of a function. |
SecurityType |
The security type of a function. |
SqlDataAccess |
How a function accesses SQL data. |
class unitycatalog.functions.CreateFunction(name: str,catalog_name: str,schema_name: str,routine_body: RoutineBody | str,parameter_style: ParameterStyle | str,security_type: SecurityType | str,*,input_params: FunctionParameterInfos | None = None,data_type: ColumnTypeName | str | None = None,full_data_type: str | None = None,return_params: FunctionParameterInfos | None = None,routine_definition: str | None = None,routine_dependencies: DependencyList | None = None,is_deterministic: bool | None = None,sql_data_access: SqlDataAccess | str | None = None,is_null_call: bool | None = None,specific_name: str | None = None,comment: str | None = None,properties: str | None = None,external_language: str | None = None,)¶
The function to create.
Attributes
- catalog_name (str) – Name of the parent catalog.
- comment (str | None) – User-provided free-form text description.
- data_type (ColumnTypeName | None) – Name of the data type of the result.
- external_language (str | None) – Name of the external language of the body, such as
python. - full_data_type (str | None) – Full data type of the result as SQL text.
- input_params (FunctionParameterInfos | None) – The input parameters of the function.
- is_deterministic (bool | None) – Whether the function is deterministic.
- is_null_call (bool | None) – Whether the function returns null when an argument is null.
- name (str) – Name of the function, relative to the parent schema.
- parameter_style (ParameterStyle | None) – Parameter style of the function.
- properties (str | None) – Key-value properties of the function, as a JSON-encoded object.
- return_params (FunctionParameterInfos | None) – The result columns of a table function.
- routine_body (RoutineBody | None) – Language of the body of the function.
- routine_definition (str | None) – Body of the function.
- routine_dependencies (DependencyList | None) – The tables and functions that the function reads.
- schema_name (str) – Name of the parent schema.
- security_type (SecurityType | None) – Security type of the function.
- specific_name (str | None) – Specific name of the function.
- sql_data_access (SqlDataAccess | None) – How the function accesses SQL data.
class unitycatalog.functions.FunctionClient¶
The requests on one FunctionInfo.
delete() → None¶
Delete a function.
Async: delete_async(…) → Future[None]
get(*, include_browse: bool | None = None) → FunctionInfo¶
Get a function.
Parameters
- include_browse (bool | None, optional) – Also answer a caller who sees the function through the
BROWSEprivilege only, with its discovery fields andbrowse_onlyset.
Returns
- FunctionInfo – A function: a user-defined function in the third layer of the three-level namespace, below a schema.
Async: get_async(…) → Future[FunctionInfo]
class unitycatalog.functions.FunctionInfo¶
A function: a user-defined function in the third layer of the three-level namespace, below a schema.
Attributes
- browse_only (bool | None) – True when the function has only the discovery fields that the
BROWSEprivilege allows. - catalog_name (str) – Name of the parent catalog.
- comment (str | None) – User-provided free-form text description.
- created_at (int) – Time at which the function was created, in epoch milliseconds.
- created_by (str | None) – Username of the creator of the function.
- data_type (ColumnTypeName | None) – Name of the data type of the result.
- external_language (str | None) – Name of the external language of the body, such as
python. - full_data_type (str | None) – Full data type of the result as SQL text.
- full_name (str) – Full name of the function, in the form
<catalog>.<schema>.<function>. - function_id (str) – Unique identifier of the function.
- input_params (FunctionParameterInfos | None) – The input parameters of the function. Absent when there are none.
- is_deterministic (bool | None) – Whether the function is deterministic.
- is_null_call (bool | None) – Whether the function returns null when an argument is null.
- name (str) – Name of the function, relative to the parent schema.
- owner (str | None) – Username of the owner of the function.
- parameter_style (ParameterStyle | None) – Parameter style of the function.
- properties (str | None) – Key-value properties of the function, as a JSON-encoded object.
- return_params (FunctionParameterInfos | None) – The result columns of a table function. Absent when there are none.
- routine_body (RoutineBody | None) – Language of the body of the function.
- routine_definition (str | None) – Body of the function.
- routine_dependencies (DependencyList | None) – The tables and functions that the function reads.
- schema_name (str) – Name of the parent schema.
- security_type (SecurityType | None) – Security type of the function.
- specific_name (str | None) – Specific name of the function.
- sql_data_access (SqlDataAccess | None) – How the function accesses SQL data.
- updated_at (int) – Time at which the function was last changed, in epoch milliseconds.
- updated_by (str | None) – Username of the user who last changed the function.
class unitycatalog.functions.FunctionParameterInfo(name: str,type_text: str,type_name: ColumnTypeName | str,*,type_json: str | None = None,type_precision: SupportsIndex | None = None,type_scale: SupportsIndex | None = None,type_interval_type: str | None = None,position: SupportsIndex | None = None,parameter_mode: FunctionParameterMode | str | None = None,parameter_type: FunctionParameterType | str | None = None,parameter_default: str | None = None,comment: str | None = None,)¶
A parameter or result column of a function.
Attributes
- comment (str | None) – User-provided free-form text description.
- name (str) – Name of the parameter.
- parameter_default (str | None) – Default value of the parameter.
- parameter_mode (FunctionParameterMode | None) – Mode of the parameter.
- parameter_type (FunctionParameterType | None) – Kind of the parameter.
- position (int | None) – Position of the parameter, starting at 0.
- type_interval_type (str | None) – Format of an interval type.
- type_json (str | None) – Full data type of the parameter as JSON.
- type_name (ColumnTypeName | None) – Name of the data type of the parameter.
- type_precision (int | None) – Digits of precision. Required for decimal types.
- type_scale (int | None) – Digits to the right of the decimal point. Required for decimal types.
- type_text (str) – Full data type of the parameter as SQL text.
class unitycatalog.functions.FunctionParameterInfos(*, parameters: SupportsGetItem[int, FunctionParameterInfo] | None = None)¶
The parameters of a function.
Attributes
- parameters (list[FunctionParameterInfo]) – The parameters.
class unitycatalog.functions.ListFunctionsResponse¶
Attributes
- functions (list[FunctionInfo]) – The functions.
- next_page_token (str | None) – Opaque token of the next page. Absent on the last page.
class unitycatalog.functions.FunctionParameterMode¶
The mode of a function parameter.
Members
- IN – An input parameter.
class unitycatalog.functions.FunctionParameterType¶
The kind of a function parameter.
Members
- PARAM – A named parameter.
- COLUMN – A column of a table function result.
class unitycatalog.functions.ParameterStyle¶
The parameter style of a function.
Members
- S – SQL parameter style.
class unitycatalog.functions.RoutineBody¶
The language of the body of a function.
Members
- SQL – The body is SQL.
- EXTERNAL – The body is in an external language, such as Python.
class unitycatalog.functions.SecurityType¶
The security type of a function.
Members
- DEFINER – The function runs with the rights of its owner.
class unitycatalog.functions.SqlDataAccess¶
How a function accesses SQL data.
Members
- CONTAINS_SQL – The function contains SQL.
- READS_SQL_DATA – The function reads SQL data.
- NO_SQL – The function does not use SQL.