start_query_execution
async
¶
start_query_execution(
query_string: QueryString,
*,
config_overrides: Optional[AsyncAthenaClientConfig] = 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/async_athena.py
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 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 | |