gpt4 book ai didi

sql - 如何在 AWS Athena 中编写多个 SQL 语句,如 CREATE 表(使用 CLI 命令 - aws athena start-query-execution --query-string {value} )?

转载 作者:行者123 更新时间:2023-12-05 07:21:33 47 4
gpt4 key购买 nike

如何通过ATHENA CLI命令编写多个CREATE TABLE语句来执行多个SQL语句-aws athena start-query-execution

我已经试过了,但只用了一个 SQL 语句,它工作正常。但是我需要运行多个SQL语句

( select count(*) from elb_logs; create external table tbl_nm; ) 通过 CLI Athena 命令。

aws athena start-query-execution \
--query-string "select count(*) from elb_logs;" \
--query-execution-context Database=default \
--result-configuration OutputLocation=s3://aws-athena-query-results-xxxxxxxxxx-us-east-1/ \
--region us-east-1 \
--output text

应该能够通过 CLI 命令在 AWS Athena 上执行多个 SQL 语句。

最佳答案

我认为你不能在一个 CLI 命令中运行多个查询,我刚刚尝试并得到了这个错误:

    An error occurred (InvalidRequestException) when calling the StartQueryExecution operation: 
Only one sql statement is allowed.

一个一个运行。

关于sql - 如何在 AWS Athena 中编写多个 SQL 语句,如 CREATE 表(使用 CLI 命令 - aws athena start-query-execution --query-string {value} )?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56846823/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com