AWS Glue
Developer Guide

User-Defined Function API

Data Types

UserDefinedFunction Structure

Represents the equivalent of a Hive user-defined function (UDF) definition.

Fields

  • FunctionName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the function.

  • ClassName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The Java class that contains the function code.

  • OwnerName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The owner of the function.

  • OwnerType – UTF-8 string (valid values: USER | ROLE | GROUP).

    The owner type.

  • CreateTime – Timestamp.

    The time at which the function was created.

  • ResourceUris – An array of ResourceUri objects, not more than 1000 structures.

    The resource URIs for the function.

UserDefinedFunctionInput Structure

A structure used to create or updata a user-defined function.

Fields

  • FunctionName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the function.

  • ClassName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The Java class that contains the function code.

  • OwnerName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The owner of the function.

  • OwnerType – UTF-8 string (valid values: USER | ROLE | GROUP).

    The owner type.

  • ResourceUris – An array of ResourceUri objects, not more than 1000 structures.

    The resource URIs for the function.

Operations

CreateUserDefinedFunction Action (Python: create_user_defined_function)

Creates a new function definition in the Data Catalog.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The ID of the Data Catalog in which to create the function. If none is supplied, the AWS account ID is used by default.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the catalog database in which to create the function.

  • FunctionInputRequired: An UserDefinedFunctionInput object.

    A FunctionInput object that defines the function to create in the Data Catalog.

Response

  • No Response parameters.

Errors

  • AlreadyExistsException

  • InvalidInputException

  • InternalServiceException

  • EntityNotFoundException

  • OperationTimeoutException

  • ResourceNumberLimitExceededException

  • GlueEncryptionException

UpdateUserDefinedFunction Action (Python: update_user_defined_function)

Updates an existing function definition in the Data Catalog.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The ID of the Data Catalog where the function to be updated is located. If none is supplied, the AWS account ID is used by default.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the catalog database where the function to be updated is located.

  • FunctionNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the function.

  • FunctionInputRequired: An UserDefinedFunctionInput object.

    A FunctionInput object that re-defines the function in the Data Catalog.

Response

  • No Response parameters.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

  • GlueEncryptionException

DeleteUserDefinedFunction Action (Python: delete_user_defined_function)

Deletes an existing function definition from the Data Catalog.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The ID of the Data Catalog where the function to be deleted is located. If none is supplied, the AWS account ID is used by default.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the catalog database where the function is located.

  • FunctionNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the function definition to be deleted.

Response

  • No Response parameters.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

GetUserDefinedFunction Action (Python: get_user_defined_function)

Retrieves a specified function definition from the Data Catalog.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The ID of the Data Catalog where the function to be retrieved is located. If none is supplied, the AWS account ID is used by default.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the catalog database where the function is located.

  • FunctionNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the function.

Response

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

  • GlueEncryptionException

GetUserDefinedFunctions Action (Python: get_user_defined_functions)

Retrieves a multiple function definitions from the Data Catalog.

Request

  • CatalogId – Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The ID of the Data Catalog where the functions to be retrieved are located. If none is supplied, the AWS account ID is used by default.

  • DatabaseNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the catalog database where the functions are located.

  • PatternRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    An optional function-name pattern string that filters the function definitions returned.

  • NextToken – UTF-8 string.

    A continuation token, if this is a continuation call.

  • MaxResults – Number (integer), not less than 1 or more than 1000.

    The maximum number of functions to return in one response.

Response

  • UserDefinedFunctions – An array of UserDefinedFunction objects.

    A list of requested function definitions.

  • NextToken – UTF-8 string.

    A continuation token, if the list of functions returned does not include the last requested function.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • OperationTimeoutException

  • InternalServiceException

  • GlueEncryptionException