我有某个 Athena 查询的查询执行 ID。我想获取此查询的输出位置。我知道我可以使用 java aws sdk 中的查询执行 id 获取结果。 我使用我的 aws 凭证创建了 AmazonAthena 类的名为“athenaClient”的 athena 客户端对象。
GetQueryResultsRequest getQueryResultsRequest = new
GetQueryResultsRequest().withExecutionId(execId);
GetQueryResultsResult getQueryResultsResult =
athenaClient.getQueryResults(getQueryResultsRequest);
使用这个 getQueryResultsResult,我可以获取查询结果。 但我想通过 Athena 查询执行 id 获取输出位置。
最佳答案
我对 Java SDK 不太了解,但可以通过 getQueryExecution
方法检索结果的位置。
所以它应该是这样的:
GetQueryExecutionResult result = athenaClient.getQueryExecution(GetQueryExecutionRequest().withExecutionId(execId));
QueryExecution exec = result.getQueryExecution();
ResultConfiguration config = exec.getResultConfiguration();
关于java - 从 Athena 查询执行 ID 获取输出位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56609978/