Skip to main content

Function

View as Markdown

FunctionInfo object

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

Function input parameters.

Show child attributesHide child attributes
parametersarray of object
Show child attributesHide child attributes
namestring

Name of Parameter.

type_textstring

Full data type spec, SQL/catalogString text.

type_jsonstring

Full data type spec, JSON-serialized.

type_namestring

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

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

Format of IntervalType.

positionint32

Ordinal position of column (starting at position 0).

parameter_modestring

Function parameter mode.

Values: IN

parameter_typestring

Function parameter type.

Values: PARAM, COLUMN

parameter_defaultstring

Default value of the parameter.

commentstring

User-provided free-form text description.

data_typestring

Scalar function return data type.

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

Pretty printed function data type.

routine_bodystring

Function language. When EXTERNAL is used, the language of the routine function should be specified in the external_language field, and the return_params of the function cannot be used (as TABLE return type is not supported), and the sql_data_access field must be NO_SQL.

Values: SQL, EXTERNAL

routine_definitionstring

Function body.

parameter_stylestring

Function parameter style. S is the value for SQL.

Values: S

is_deterministicboolean

Whether the function is deterministic.

sql_data_accessstring

Function SQL data access.

Values: CONTAINS_SQL, READS_SQL_DATA, NO_SQL

is_null_callboolean

Function null call.

security_typestring

Function security type.

Values: DEFINER

specific_namestring

Specific name of the function; Reserved for future use.

return_paramsobject

Table function return parameters.

Show child attributesHide child attributes
parametersarray of object
Show child attributesHide child attributes
namestring

Name of Parameter.

type_textstring

Full data type spec, SQL/catalogString text.

type_jsonstring

Full data type spec, JSON-serialized.

type_namestring

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

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

Format of IntervalType.

positionint32

Ordinal position of column (starting at position 0).

parameter_modestring

Function parameter mode.

Values: IN

parameter_typestring

Function parameter type.

Values: PARAM, COLUMN

parameter_defaultstring

Default value of the parameter.

commentstring

User-provided free-form text description.

external_namestring

External function name.

external_languagestring

External function language.

sql_pathstring

List of schemes 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.

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.

List 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_namestringquery

Name of parent catalog for functions of interest.

schema_namestringquery

Parent schema of functions.

include_browsebooleanquery

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

max_resultsint32query

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;

Constraints: <= 1000

page_tokenstringquery

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

Response

Returns a list of FunctionInfo objects.