AWS Glue

2026/11/06 - AWS Glue - 4 updated api methods

Changes  Adds support for user-defined functions governed by AWS Lake Formation.

CreateUserDefinedFunction (updated) Link ¶
Changes (request)
{'FunctionInput': {'ArtifactLocation': 'string',
                   'GovernanceMode': 'IAM_ONLY | LAKE_FORMATION',
                   'ResourceUris': {'LastModified': 'timestamp'}}}

Creates a new function definition in the Data Catalog.

See also: AWS API Documentation

Request Syntax

client.create_user_defined_function(
    CatalogId='string',
    DatabaseName='string',
    FunctionInput={
        'FunctionName': 'string',
        'ClassName': 'string',
        'OwnerName': 'string',
        'FunctionType': 'REGULAR_FUNCTION'|'AGGREGATE_FUNCTION'|'STORED_PROCEDURE',
        'OwnerType': 'USER'|'ROLE'|'GROUP',
        'ResourceUris': [
            {
                'ResourceType': 'JAR'|'FILE'|'ARCHIVE',
                'Uri': 'string',
                'LastModified': datetime(2015, 1, 1)
            },
        ],
        'ArtifactLocation': 'string',
        'GovernanceMode': 'IAM_ONLY'|'LAKE_FORMATION'
    }
)
type CatalogId:

string

param CatalogId:

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.

type DatabaseName:

string

param DatabaseName:

[REQUIRED]

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

type FunctionInput:

dict

param FunctionInput:

[REQUIRED]

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

  • FunctionName (string) --

    The name of the function.

  • ClassName (string) --

    The Java class that contains the function code.

  • OwnerName (string) --

    The owner of the function.

  • FunctionType (string) --

    The type of the function.

  • OwnerType (string) --

    The owner type.

  • ResourceUris (list) --

    The resource URIs for the function.

    • (dict) --

      The URIs for function resources.

      • ResourceType (string) --

        The type of the resource.

      • Uri (string) --

        The URI for accessing the resource.

      • LastModified (datetime) --

        The time at which the resource was last modified in Amazon S3. Glue records this value when you create or update a function whose GovernanceMode is LAKE_FORMATION. Analytics engines use it to verify that the resource hasn't changed. This is an output-only field.

  • ArtifactLocation (string) --

    The Amazon S3 location that contains the function's artifacts. Required when GovernanceMode is LAKE_FORMATION. You must register the location with Lake Formation, and every resource URI must be under this location.

  • GovernanceMode (string) --

    How access to the function is governed. Specify LAKE_FORMATION to manage access to the function with Lake Formation permissions. If you don't specify a value, the default is IAM_ONLY. You can't change the governance mode after the function is created.

    When GovernanceMode is LAKE_FORMATION:

    • You must be a data lake administrator or have all permissions on the Data Catalog with the grant option.

    • You must have the DATA_LOCATION_ACCESS permission on the ArtifactLocation, unless you're a data lake administrator.

    • You must specify from 1 to 10 resource URIs, each under the ArtifactLocation.

    • You can't rename the function.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

GetUserDefinedFunction (updated) Link ¶
Changes (response)
{'UserDefinedFunction': {'ArtifactLocation': 'string',
                         'GovernanceMode': 'IAM_ONLY | LAKE_FORMATION',
                         'ResourceUris': {'LastModified': 'timestamp'}}}

Retrieves a specified function definition from the Data Catalog.

See also: AWS API Documentation

Request Syntax

client.get_user_defined_function(
    CatalogId='string',
    DatabaseName='string',
    FunctionName='string'
)
type CatalogId:

string

param CatalogId:

The ID of the Data Catalog where the function to be retrieved is located. If none is provided, the Amazon Web Services account ID is used by default.

type DatabaseName:

string

param DatabaseName:

[REQUIRED]

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

type FunctionName:

string

param FunctionName:

[REQUIRED]

The name of the function.

rtype:

dict

returns:

Response Syntax

{
    'UserDefinedFunction': {
        'FunctionName': 'string',
        'DatabaseName': 'string',
        'ClassName': 'string',
        'OwnerName': 'string',
        'FunctionType': 'REGULAR_FUNCTION'|'AGGREGATE_FUNCTION'|'STORED_PROCEDURE',
        'OwnerType': 'USER'|'ROLE'|'GROUP',
        'CreateTime': datetime(2015, 1, 1),
        'ResourceUris': [
            {
                'ResourceType': 'JAR'|'FILE'|'ARCHIVE',
                'Uri': 'string',
                'LastModified': datetime(2015, 1, 1)
            },
        ],
        'ArtifactLocation': 'string',
        'GovernanceMode': 'IAM_ONLY'|'LAKE_FORMATION',
        'CatalogId': 'string'
    }
}

Response Structure

  • (dict) --

    • UserDefinedFunction (dict) --

      The requested function definition.

      • FunctionName (string) --

        The name of the function.

      • DatabaseName (string) --

        The name of the catalog database that contains the function.

      • ClassName (string) --

        The Java class that contains the function code.

      • OwnerName (string) --

        The owner of the function.

      • FunctionType (string) --

        The type of the function.

      • OwnerType (string) --

        The owner type.

      • CreateTime (datetime) --

        The time at which the function was created.

      • ResourceUris (list) --

        The resource URIs for the function.

        • (dict) --

          The URIs for function resources.

          • ResourceType (string) --

            The type of the resource.

          • Uri (string) --

            The URI for accessing the resource.

          • LastModified (datetime) --

            The time at which the resource was last modified in Amazon S3. Glue records this value when you create or update a function whose GovernanceMode is LAKE_FORMATION. Analytics engines use it to verify that the resource hasn't changed. This is an output-only field.

      • ArtifactLocation (string) --

        The Amazon S3 location that contains the function's artifacts. This location must be registered with Lake Formation. Glue returns this field only for functions whose GovernanceMode is LAKE_FORMATION.

      • GovernanceMode (string) --

        How access to the function is governed. IAM_ONLY means access is controlled by IAM permissions only. LAKE_FORMATION means Lake Formation permissions ( EXECUTE, DESCRIBE, ALTER, and DROP) also control who can run, describe, update, and delete the function.

      • CatalogId (string) --

        The ID of the Data Catalog in which the function resides.

GetUserDefinedFunctions (updated) Link ¶
Changes (response)
{'UserDefinedFunctions': {'ArtifactLocation': 'string',
                          'GovernanceMode': 'IAM_ONLY | LAKE_FORMATION',
                          'ResourceUris': {'LastModified': 'timestamp'}}}

Retrieves multiple function definitions from the Data Catalog.

See also: AWS API Documentation

Request Syntax

client.get_user_defined_functions(
    CatalogId='string',
    DatabaseName='string',
    Pattern='string',
    FunctionType='REGULAR_FUNCTION'|'AGGREGATE_FUNCTION'|'STORED_PROCEDURE',
    NextToken='string',
    MaxResults=123
)
type CatalogId:

string

param CatalogId:

The ID of the Data Catalog where the functions to be retrieved are located. If none is provided, the Amazon Web Services account ID is used by default.

type DatabaseName:

string

param DatabaseName:

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.

type Pattern:

string

param Pattern:

[REQUIRED]

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

type FunctionType:

string

param FunctionType:

An optional function-type pattern string that filters the function definitions returned from Amazon Redshift Federated Permissions Catalog.

Specify a value of REGULAR_FUNCTION or STORED_PROCEDURE. The STORED_PROCEDURE function type is only compatible with Amazon Redshift Federated Permissions Catalog.

type NextToken:

string

param NextToken:

A continuation token, if this is a continuation call.

type MaxResults:

integer

param MaxResults:

The maximum number of functions to return in one response.

rtype:

dict

returns:

Response Syntax

{
    'UserDefinedFunctions': [
        {
            'FunctionName': 'string',
            'DatabaseName': 'string',
            'ClassName': 'string',
            'OwnerName': 'string',
            'FunctionType': 'REGULAR_FUNCTION'|'AGGREGATE_FUNCTION'|'STORED_PROCEDURE',
            'OwnerType': 'USER'|'ROLE'|'GROUP',
            'CreateTime': datetime(2015, 1, 1),
            'ResourceUris': [
                {
                    'ResourceType': 'JAR'|'FILE'|'ARCHIVE',
                    'Uri': 'string',
                    'LastModified': datetime(2015, 1, 1)
                },
            ],
            'ArtifactLocation': 'string',
            'GovernanceMode': 'IAM_ONLY'|'LAKE_FORMATION',
            'CatalogId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • UserDefinedFunctions (list) --

      A list of requested function definitions.

      • (dict) --

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

        • FunctionName (string) --

          The name of the function.

        • DatabaseName (string) --

          The name of the catalog database that contains the function.

        • ClassName (string) --

          The Java class that contains the function code.

        • OwnerName (string) --

          The owner of the function.

        • FunctionType (string) --

          The type of the function.

        • OwnerType (string) --

          The owner type.

        • CreateTime (datetime) --

          The time at which the function was created.

        • ResourceUris (list) --

          The resource URIs for the function.

          • (dict) --

            The URIs for function resources.

            • ResourceType (string) --

              The type of the resource.

            • Uri (string) --

              The URI for accessing the resource.

            • LastModified (datetime) --

              The time at which the resource was last modified in Amazon S3. Glue records this value when you create or update a function whose GovernanceMode is LAKE_FORMATION. Analytics engines use it to verify that the resource hasn't changed. This is an output-only field.

        • ArtifactLocation (string) --

          The Amazon S3 location that contains the function's artifacts. This location must be registered with Lake Formation. Glue returns this field only for functions whose GovernanceMode is LAKE_FORMATION.

        • GovernanceMode (string) --

          How access to the function is governed. IAM_ONLY means access is controlled by IAM permissions only. LAKE_FORMATION means Lake Formation permissions ( EXECUTE, DESCRIBE, ALTER, and DROP) also control who can run, describe, update, and delete the function.

        • CatalogId (string) --

          The ID of the Data Catalog in which the function resides.

    • NextToken (string) --

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

UpdateUserDefinedFunction (updated) Link ¶
Changes (request)
{'FunctionInput': {'ArtifactLocation': 'string',
                   'GovernanceMode': 'IAM_ONLY | LAKE_FORMATION',
                   'ResourceUris': {'LastModified': 'timestamp'}}}

Updates an existing function definition in the Data Catalog.

See also: AWS API Documentation

Request Syntax

client.update_user_defined_function(
    CatalogId='string',
    DatabaseName='string',
    FunctionName='string',
    FunctionInput={
        'FunctionName': 'string',
        'ClassName': 'string',
        'OwnerName': 'string',
        'FunctionType': 'REGULAR_FUNCTION'|'AGGREGATE_FUNCTION'|'STORED_PROCEDURE',
        'OwnerType': 'USER'|'ROLE'|'GROUP',
        'ResourceUris': [
            {
                'ResourceType': 'JAR'|'FILE'|'ARCHIVE',
                'Uri': 'string',
                'LastModified': datetime(2015, 1, 1)
            },
        ],
        'ArtifactLocation': 'string',
        'GovernanceMode': 'IAM_ONLY'|'LAKE_FORMATION'
    }
)
type CatalogId:

string

param CatalogId:

The ID of the Data Catalog where the function to be updated is located. If none is provided, the Amazon Web Services account ID is used by default.

type DatabaseName:

string

param DatabaseName:

[REQUIRED]

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

type FunctionName:

string

param FunctionName:

[REQUIRED]

The name of the function.

type FunctionInput:

dict

param FunctionInput:

[REQUIRED]

A FunctionInput object that redefines the function in the Data Catalog.

  • FunctionName (string) --

    The name of the function.

  • ClassName (string) --

    The Java class that contains the function code.

  • OwnerName (string) --

    The owner of the function.

  • FunctionType (string) --

    The type of the function.

  • OwnerType (string) --

    The owner type.

  • ResourceUris (list) --

    The resource URIs for the function.

    • (dict) --

      The URIs for function resources.

      • ResourceType (string) --

        The type of the resource.

      • Uri (string) --

        The URI for accessing the resource.

      • LastModified (datetime) --

        The time at which the resource was last modified in Amazon S3. Glue records this value when you create or update a function whose GovernanceMode is LAKE_FORMATION. Analytics engines use it to verify that the resource hasn't changed. This is an output-only field.

  • ArtifactLocation (string) --

    The Amazon S3 location that contains the function's artifacts. Required when GovernanceMode is LAKE_FORMATION. You must register the location with Lake Formation, and every resource URI must be under this location.

  • GovernanceMode (string) --

    How access to the function is governed. Specify LAKE_FORMATION to manage access to the function with Lake Formation permissions. If you don't specify a value, the default is IAM_ONLY. You can't change the governance mode after the function is created.

    When GovernanceMode is LAKE_FORMATION:

    • You must be a data lake administrator or have all permissions on the Data Catalog with the grant option.

    • You must have the DATA_LOCATION_ACCESS permission on the ArtifactLocation, unless you're a data lake administrator.

    • You must specify from 1 to 10 resource URIs, each under the ArtifactLocation.

    • You can't rename the function.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --