User-defined Function API
The User-defined Function API describes AWS Glue data types and operations used in working with functions.
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.
-
DatabaseName– 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 that contains 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.
-
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 the function resides.
UserDefinedFunctionInput structure
A structure used to create or update 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)
UpdateUserDefinedFunction action (Python: update_user_defined_function)
DeleteUserDefinedFunction action (Python: delete_user_defined_function)
GetUserDefinedFunction action (Python: get_user_defined_function)
GetUserDefinedFunctions action (Python: get_user_defined_functions)
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 provided, the AWS account ID is used by default.
-
DatabaseName– Required: 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.
-
FunctionInput– Required: An UserDefinedFunctionInput object.A
FunctionInputobject that defines the function to create in the Data Catalog.
Response
No Response parameters.
Errors
AlreadyExistsExceptionInvalidInputExceptionInternalServiceExceptionEntityNotFoundExceptionOperationTimeoutExceptionResourceNumberLimitExceededExceptionGlueEncryptionException
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 provided, the AWS account ID is used by default.
-
DatabaseName– Required: 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.
-
FunctionName– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the function.
-
FunctionInput– Required: An UserDefinedFunctionInput object.A
FunctionInputobject that redefines the function in the Data Catalog.
Response
No Response parameters.
Errors
EntityNotFoundExceptionInvalidInputExceptionInternalServiceExceptionOperationTimeoutExceptionGlueEncryptionException
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.
-
DatabaseName– Required: 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.
-
FunctionName– Required: 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
EntityNotFoundExceptionInvalidInputExceptionInternalServiceExceptionOperationTimeoutException
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 provided, the AWS account ID is used by default.
-
DatabaseName– Required: 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.
-
FunctionName– Required: 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
-
UserDefinedFunction– An UserDefinedFunction object.The requested function definition.
Errors
EntityNotFoundExceptionInvalidInputExceptionInternalServiceExceptionOperationTimeoutExceptionGlueEncryptionException
GetUserDefinedFunctions action (Python: get_user_defined_functions)
Retrieves 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 provided, the AWS account ID is used by default.
-
DatabaseName– 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. If none is provided, functions from all the databases across the catalog will be returned.
-
Pattern– Required: 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 100.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
EntityNotFoundExceptionInvalidInputExceptionOperationTimeoutExceptionInternalServiceExceptionGlueEncryptionException