Skip to main content

user_defined_functions

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

Overview

Nameuser_defined_functions
TypeResource
Idaws.glue.user_defined_functions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
catalog_idstringThe ID of the Data Catalog in which the function resides. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
class_namestringThe Java class that contains the function code. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
create_timestring (date-time)The time at which the function was created.
database_namestringThe name of the catalog database that contains the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
function_namestringThe name of the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
function_typestringThe type of the function. (REGULAR_FUNCTION, AGGREGATE_FUNCTION, STORED_PROCEDURE)
owner_namestringThe owner of the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
owner_typestringThe owner type. (USER, ROLE, GROUP)
resource_urisarrayThe resource URIs for the function.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_defined_functionselectregionRetrieves a specified function definition from the Data Catalog.
get_user_defined_functionsselectregionRetrieves multiple function definitions from the Data Catalog.
create_user_defined_functioninsertregion, DatabaseName, FunctionInputCreates a new function definition in the Data Catalog.
update_user_defined_functionupdateregion, DatabaseName, FunctionName, FunctionInputUpdates an existing function definition in the Data Catalog.
delete_user_defined_functiondeleteregionDeletes an existing function definition from the Data Catalog.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves a specified function definition from the Data Catalog.

SELECT
catalog_id,
class_name,
create_time,
database_name,
function_name,
function_type,
owner_name,
owner_type,
resource_uris
FROM aws.glue.user_defined_functions
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new function definition in the Data Catalog.

INSERT INTO aws.glue.user_defined_functions (
CatalogId,
DatabaseName,
FunctionInput,
region
)
SELECT
'{{ CatalogId }}',
'{{ DatabaseName }}' /* required */,
'{{ FunctionInput }}' /* required */,
'{{ region }}'
;

UPDATE examples

Updates an existing function definition in the Data Catalog.

UPDATE aws.glue.user_defined_functions
SET
CatalogId = '{{ CatalogId }}',
DatabaseName = '{{ DatabaseName }}',
FunctionName = '{{ FunctionName }}',
FunctionInput = '{{ FunctionInput }}'
WHERE
region = '{{ region }}' --required
AND DatabaseName = '{{ DatabaseName }}' --required
AND FunctionName = '{{ FunctionName }}' --required
AND FunctionInput = '{{ FunctionInput }}' --required;

DELETE examples

Deletes an existing function definition from the Data Catalog.

DELETE FROM aws.glue.user_defined_functions
WHERE region = '{{ region }}' --required
;