Skip to content

batch_get_named_query async

batch_get_named_query(
    named_query_ids: NamedQueryIdList,
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
) -> BatchGetNamedQueryOutput

Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use ListNamedQueriesInput to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under UnprocessedNamedQueryId. Named queries differ from executed queries. Use BatchGetQueryExecutionInput to get details about each unique query execution, and ListQueryExecutionsInput to get a list of query execution IDs.

Parameters:

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/async_athena.py
async def batch_get_named_query(
    self,
    named_query_ids: "capo_athena.types.named_query_id_list.NamedQueryIdList",
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
) -> "capo_athena.types.batch_get_named_query_output.BatchGetNamedQueryOutput":
    """<p>Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use <a>ListNamedQueriesInput</a> to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under <a>UnprocessedNamedQueryId</a>. Named queries differ from executed queries. Use <a>BatchGetQueryExecutionInput</a> to get details about each unique query execution, and <a>ListQueryExecutionsInput</a> to get a list of query execution IDs.</p>

    Args:
        named_query_ids: <p>An array of query IDs.</p>

    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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_athena.types.batch_get_named_query_input.BatchGetNamedQueryInput]",
    ) -> AsyncOperationResponse[
        "capo_athena.types.batch_get_named_query_output.BatchGetNamedQueryOutput"
    ]:
        import capo_athena._operations.amazon_athena.batch_get_named_query

        (
            output,
            http_response,
        ) = await capo_athena._operations.amazon_athena.batch_get_named_query.async_batch_get_named_query(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetNamedQuery")
    )
    input_: capo_athena.types.batch_get_named_query_input.BatchGetNamedQueryInput = {
        "named_query_ids": named_query_ids
    }

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