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,
engine_version: Optional[NameString] = 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.Note: When using StartQueryExecution, only the Classifications field applies. Do not specify the other fields (AdditionalConfigs, CoordinatorDpuSize, DefaultExecutorDpuSize, MaxConcurrentDpus, and SparkProperties), as these are used only with StartSession to configure Apache Spark-based sessions.
-
engine_version(Optional[NameString], default:None) –The engine version to run this query on, overriding the engine version of the workgroup for this query only. Possible values are determined by the output of
ListEngineVersions.AUTOis not supported. If not specified, the query runs on the engine version of the workgroup.
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
4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 | |