Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
Parameters:
-
id
(UUID)
–
The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatement, and ListStatements.
-
wait_time_seconds
(Optional[WaitTimeSeconds], default:
None
)
–
The number of seconds to wait for the SQL statement to complete execution before returning the description. The maximum value is 30 seconds.
Raises:
Source code in docs_src/capo_redshift_data/_services/redshift_data.py
| def describe_statement(
self,
id: "capo_redshift_data.types.uuid.UUID",
*,
config_overrides: Optional[RedshiftDataClientConfig] = None,
wait_time_seconds: Optional[
"capo_redshift_data.types.wait_time_seconds.WaitTimeSeconds"
] = None,
) -> (
"capo_redshift_data.types.describe_statement_response.DescribeStatementResponse"
):
"""<p>Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement. </p> <p>For more information about the Amazon Redshift Data API and CLI usage examples, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html">Using the Amazon Redshift Data API</a> in the <i>Amazon Redshift Management Guide</i>. </p>
Args:
id: <p>The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, <code>d9b6c0c9-0747-4bf4-b142-e8883122f766:2</code> has a suffix of <code>:2</code> that indicates the second SQL statement of a batch query. This identifier is returned by <code>BatchExecuteStatment</code>, <code>ExecuteStatement</code>, and <code>ListStatements</code>. </p>
wait_time_seconds: <p>The number of seconds to wait for the SQL statement to complete execution before returning the description. The maximum value is 30 seconds.</p>
Raises:
capo_redshift_data.errors.active_waiting_requests_exceeded_exception.ActiveWaitingRequestsExceededException: <p>The number of active requests with <code>WaitTimeSeconds</code> for the same SQL statement exceeds the limit.</p>
capo_redshift_data.errors.internal_server_exception.InternalServerException: <p>The Amazon Redshift Data API operation failed due to invalid input. </p>
capo_redshift_data.errors.resource_not_found_exception.ResourceNotFoundException: <p>The Amazon Redshift Data API operation failed due to a missing resource. </p>
capo_redshift_data.errors.validation_exception.ValidationException: <p>The Amazon Redshift Data API operation failed due to invalid input. </p>
capo_redshift_data.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_redshift_data.types.describe_statement_request.DescribeStatementRequest]",
) -> OperationResponse[
"capo_redshift_data.types.describe_statement_response.DescribeStatementResponse"
]:
import capo_redshift_data._operations.redshift_data.describe_statement
output, http_response = (
capo_redshift_data._operations.redshift_data.describe_statement.describe_statement(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeStatement")
)
input_: capo_redshift_data.types.describe_statement_request.DescribeStatementRequest = {
"id": id
}
if wait_time_seconds is not None:
input_["wait_time_seconds"] = wait_time_seconds
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|