Skip to content

create_user_defined_function async

create_user_defined_function(
    database_name: NameString,
    function_input: UserDefinedFunctionInput,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> CreateUserDefinedFunctionResponse

Creates a new function definition in the Data Catalog.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    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.

  • database_name (NameString) –

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

  • function_input (UserDefinedFunctionInput) –

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

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def create_user_defined_function(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    function_input: "capo_glue.types.user_defined_function_input.UserDefinedFunctionInput",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.create_user_defined_function_response.CreateUserDefinedFunctionResponse":
    """<p>Creates a new function definition in the Data Catalog.</p>

    Args:
        catalog_id: <p>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.</p>
        database_name: <p>The name of the catalog database in which to create the function.</p>
        function_input: <p>A <code>FunctionInput</code> object that defines the function to create in the Data Catalog.</p>

    Raises:
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.create_user_defined_function_request.CreateUserDefinedFunctionRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.create_user_defined_function_response.CreateUserDefinedFunctionResponse"
    ]:
        import capo_glue._operations.aws_glue.create_user_defined_function

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.create_user_defined_function.async_create_user_defined_function(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateUserDefinedFunction")
    )
    input_: capo_glue.types.create_user_defined_function_request.CreateUserDefinedFunctionRequest = {
        "database_name": database_name,
        "function_input": function_input,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output