Skip to content

start_query_planning

start_query_planning(
    query_planning_context: QueryPlanningContext,
    query_string: SyntheticStartQueryPlanningRequestQueryString,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
) -> StartQueryPlanningResponse

Submits a request to process a query statement.

This operation generates work units that can be retrieved with the GetWorkUnits operation as soon as the query state is WORKUNITS_AVAILABLE or FINISHED.

Parameters:

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def start_query_planning(
    self,
    query_planning_context: "capo_lakeformation.types.query_planning_context.QueryPlanningContext",
    query_string: "capo_lakeformation.types.synthetic_start_query_planning_request_query_string.SyntheticStartQueryPlanningRequestQueryString",
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
) -> "capo_lakeformation.types.start_query_planning_response.StartQueryPlanningResponse":
    """<p>Submits a request to process a query statement.</p> <p>This operation generates work units that can be retrieved with the <code>GetWorkUnits</code> operation as soon as the query state is WORKUNITS_AVAILABLE or FINISHED.</p>

    Args:
        query_planning_context: <p>A structure containing information about the query plan.</p>
        query_string: <p>A PartiQL query statement used as an input to the planner service.</p>

    Raises:
        capo_lakeformation.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_lakeformation.errors.throttled_exception.ThrottledException: <p>Contains details about an error where the query request was throttled.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lakeformation.types.start_query_planning_request.StartQueryPlanningRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.start_query_planning_response.StartQueryPlanningResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.start_query_planning

        output, http_response = (
            capo_lakeformation._operations.aws_lake_formation.start_query_planning.start_query_planning(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_lakeformation.types.start_query_planning_request.StartQueryPlanningRequest",
    ) -> dict[str, Any]:
        import capo_lakeformation.types.start_query_planning_request

        return (
            capo_lakeformation.types.start_query_planning_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartQueryPlanning", redact_input=_redact_input),
    )
    input_: capo_lakeformation.types.start_query_planning_request.StartQueryPlanningRequest = {
        "query_planning_context": query_planning_context,
        "query_string": query_string,
    }

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