在AW Athena中执行一组查询作为批处理

问题描述 投票:1回答:1

我正在尝试使用aws-java-sdk-athena批量执行AWS Athena查询。我能够建立连接,单独运行查询,但不知道如何批量运行3个查询。任何帮助赞赏。

询问

 1.select * from table1 limit 2
 2.select * from table2 limit 2
 3.select * from table3 limit 2
amazon-web-services batch-processing amazon-athena aws-java-sdk
1个回答
0
投票

您可以在Athena中并行运行多个查询。它们将在后台执行。因此,如果您使用例如

StartQueryExecutionResult startQueryExecutionResult = client.startQueryExecution(startQueryExecutionRequest);

你会得到一个executionId。然后,可以使用它来查询正在运行的查询的状态,以检查它们是否已经完成。您可以使用getQueryExecutionIdbatchGetQueryExecution获取查询的执行状态。

Limits

雅典娜有一些限制。您最多可以并行运行20个SELECT查询。

documentation

20个DDL查询同时进行。 DDL查询包括CREATE TABLE和CREATE TABLE ADD PARTITION查询。

20个DML查询同时进行。 DML查询包括SELECT和CREATE TABLE AS(CTAS)查询。

© www.soinside.com 2019 - 2024. All rights reserved.