使用Boto客户端在雅典娜上执行查询时出现QueryString错误

时间:2019-07-30 20:10:58

标签: python amazon-s3 boto3 boto amazon-athena

我正在尝试使用Athena boto客户端执行查询。

self.athena_client = boto3.client('athena')

response = self.athena_client.start_query_execution(
                QueryString=sql.format(**query_params) if query_params else sql,
                ResultConfiguration={
                    'OutputLocation': '...'
                }
            )

但是下面出现错误:

Invalid length for parameter QueryString, value: 0, valid range: 1-inf

我不知道根本原因是什么。

1 个答案:

答案 0 :(得分:0)

您应该证明自己已正确将QueryString参数发送到boto方法start_query_execution

这是一个必需参数,例如,当您请求发送带有空字符串的QueryString时,它将抛出此错误。

  

boto3 docs处查看更多内容