【问题标题】:Got QueryString error when executing query on athena with boto client使用 boto 客户端在 athena 上执行查询时出现 QueryString 错误
【发布时间】:2019-12-08 07:09:36
【问题描述】:

我正在尝试使用 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

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

【问题讨论】:

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


    【解决方案1】:

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

    这是一个必填参数,例如,当您使用空字符串请求发送QueryString 时,它会抛出此错误。

    boto3 docs查看更多信息

    【讨论】:

      猜你喜欢
      • 2019-10-18
      • 1970-01-01
      • 1970-01-01
      • 2016-11-11
      • 1970-01-01
      • 2021-09-28
      • 2021-03-27
      • 2012-02-22
      • 2020-06-03
      相关资源
      最近更新 更多