Skip to content

update_data_catalog

update_data_catalog(
    name: CatalogNameString,
    type: DataCatalogType,
    *,
    config_overrides: Optional[AthenaClientConfig] = None,
    description: Optional[DescriptionString] = None,
    parameters: Optional[ParametersMap] = None,
) -> UpdateDataCatalogOutput

Updates the data catalog that has the specified name.

Parameters:

  • name (CatalogNameString) –

    The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.

  • type (DataCatalogType) –

    Specifies the type of data catalog to update. Specify LAMBDA for a federated catalog, HIVE for an external hive metastore, or GLUE for an Glue Data Catalog.

  • description (Optional[DescriptionString], default: None ) –

    New or modified text that describes the data catalog.

  • parameters (Optional[ParametersMap], default: None ) –

    Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type.

    • For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.

      metadata-function=lambda_arn, sdk-version=version_number

    • For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.

      • If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.

        metadata-function=lambda_arn, record-function=lambda_arn

      • If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.

        function=lambda_arn

Raises:

  • InternalServerException –

    Indicates a platform issue, which may be due to a transient condition or outage.

  • InvalidRequestException –

    Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_athena/_services/athena.py
def update_data_catalog(
    self,
    name: "capo_athena.types.catalog_name_string.CatalogNameString",
    type: "capo_athena.types.data_catalog_type.DataCatalogType",
    *,
    config_overrides: Optional[AthenaClientConfig] = None,
    description: Optional[
        "capo_athena.types.description_string.DescriptionString"
    ] = None,
    parameters: Optional["capo_athena.types.parameters_map.ParametersMap"] = None,
) -> "capo_athena.types.update_data_catalog_output.UpdateDataCatalogOutput":
    """<p>Updates the data catalog that has the specified name.</p>

    Args:
        name: <p>The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>
        type: <p>Specifies the type of data catalog to update. Specify <code>LAMBDA</code> for a federated catalog, <code>HIVE</code> for an external hive metastore, or <code>GLUE</code> for an Glue Data Catalog.</p>
        description: <p>New or modified text that describes the data catalog.</p>
        parameters: <p>Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda_arn</i>, sdk-version=<i>version_number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda_arn</i>, record-function=<i>lambda_arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> </ul>

    Raises:
        capo_athena.errors.internal_server_exception.InternalServerException: <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
        capo_athena.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_athena.types.update_data_catalog_input.UpdateDataCatalogInput]",
    ) -> OperationResponse[
        "capo_athena.types.update_data_catalog_output.UpdateDataCatalogOutput"
    ]:
        import capo_athena._operations.amazon_athena.update_data_catalog

        output, http_response = (
            capo_athena._operations.amazon_athena.update_data_catalog.update_data_catalog(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDataCatalog")
    )
    input_: capo_athena.types.update_data_catalog_input.UpdateDataCatalogInput = {
        "name": name,
        "type": type,
    }
    if description is not None:
        input_["description"] = description
    if parameters is not None:
        input_["parameters"] = parameters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output