user_defined_functions
Creates, updates, deletes, gets or lists a user_defined_functions resource.
Overview
| Name | user_defined_functions |
| Type | Resource |
| Id | aws.glue.user_defined_functions |
Fields
The following fields are returned by SELECT queries:
- get_user_defined_function
- get_user_defined_functions
| Name | Datatype | Description |
|---|---|---|
catalog_id | string | The ID of the Data Catalog in which the function resides. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
class_name | string | The Java class that contains the function code. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
create_time | string (date-time) | The time at which the function was created. |
database_name | string | The name of the catalog database that contains the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
function_name | string | The name of the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
function_type | string | The type of the function. (REGULAR_FUNCTION, AGGREGATE_FUNCTION, STORED_PROCEDURE) |
owner_name | string | The owner of the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
owner_type | string | The owner type. (USER, ROLE, GROUP) |
resource_uris | array | The resource URIs for the function. |
| Name | Datatype | Description |
|---|---|---|
catalog_id | string | The ID of the Data Catalog in which the function resides. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
class_name | string | The Java class that contains the function code. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
create_time | string (date-time) | The time at which the function was created. |
database_name | string | The name of the catalog database that contains the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
function_name | string | The name of the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
function_type | string | The type of the function. (REGULAR_FUNCTION, AGGREGATE_FUNCTION, STORED_PROCEDURE) |
owner_name | string | The owner of the function. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
owner_type | string | The owner type. (USER, ROLE, GROUP) |
resource_uris | array | The resource URIs for the function. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_user_defined_function | select | region | Retrieves a specified function definition from the Data Catalog. | |
get_user_defined_functions | select | region | Retrieves multiple function definitions from the Data Catalog. | |
create_user_defined_function | insert | region, DatabaseName, FunctionInput | Creates a new function definition in the Data Catalog. | |
update_user_defined_function | update | region, DatabaseName, FunctionName, FunctionInput | Updates an existing function definition in the Data Catalog. | |
delete_user_defined_function | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_user_defined_function
- get_user_defined_functions
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
;
Retrieves multiple function definitions 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
- create_user_defined_function
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: user_defined_functions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the user_defined_functions resource.
- name: CatalogId
value: "{{ CatalogId }}"
description: |
The ID of the Data Catalog in which to create the function. If none is provided, the Amazon Web Services account ID is used by default.
- name: DatabaseName
value: "{{ DatabaseName }}"
description: |
The name of the catalog database in which to create the function.
- name: FunctionInput
description: |
A FunctionInput object that defines the function to create in the Data Catalog.
value:
FunctionName: "{{ FunctionName }}"
ClassName: "{{ ClassName }}"
OwnerName: "{{ OwnerName }}"
FunctionType: "{{ FunctionType }}"
OwnerType: "{{ OwnerType }}"
ResourceUris:
- ResourceType: "{{ ResourceType }}"
Uri: "{{ Uri }}"
UPDATE examples
- update_user_defined_function
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
- delete_user_defined_function
Deletes an existing function definition from the Data Catalog.
DELETE FROM aws.glue.user_defined_functions
WHERE region = '{{ region }}' --required
;