start_query_execution
¶
start_query_execution(
query_string: QueryString,
*,
config_overrides: Optional[AthenaClientConfig] = None,
client_request_token: Optional[IdempotencyToken] = None,
query_execution_context: Optional[QueryExecutionContext] = None,
result_configuration: Optional[ResultConfiguration] = None,
work_group: Optional[WorkGroupName] = None,
execution_parameters: Optional[ExecutionParameters] = None,
result_reuse_configuration: Optional[ResultReuseConfiguration] = None,
engine_configuration: Optional[EngineConfiguration] = None,
) -> StartQueryExecutionOutput
Runs the SQL query statements contained in the Query. Requires you to have access to the workgroup in which the query ran. Running queries against an external catalog requires GetDataCatalog permission to the catalog. For code samples using the Amazon Web Services SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameters:
-
query_string(QueryString) –The SQL query statements to be executed.
-
client_request_token(Optional[IdempotencyToken], default:None) –A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another
StartQueryExecutionrequest is received, the same response is returned and another query is not created. An error is returned if a parameter, such asQueryString, has changed. A call toStartQueryExecutionthat uses a previous client request token returns the sameQueryExecutionIdeven if the requester doesn't have permission on the tables specified inQueryString.This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.
-
query_execution_context(Optional[QueryExecutionContext], default:None) –The database within which the query executes.
-
result_configuration(Optional[ResultConfiguration], default:None) –Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
-
work_group(Optional[WorkGroupName], default:None) –The name of the workgroup in which the query is being started.
-
execution_parameters(Optional[ExecutionParameters], default:None) –A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.
-
result_reuse_configuration(Optional[ResultReuseConfiguration], default:None) –Specifies the query result reuse behavior for the query.
-
engine_configuration(Optional[EngineConfiguration], default:None) –The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs).
To specify minimum and maximum DPU values for Capacity Reservations queries, the workgroup containing
EngineConfigurationshould have the following values: The name of theClassificationsshould beathena-query-engine-properties, with the only allowed properties asmax-dpu-countandmin-dpu-count.
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.
-
TooManyRequestsException–Indicates that the request was throttled.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_athena/_services/athena.py
3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 | |