amazon-web-services - 如何通过 boto3 获取对 athena 的查询错误?
问题描述
如果查询失败,boto3 是否有任何方法允许获取错误文本?get_query_execution
仅返回查询的状态。
解决方案
'StateChangeReason'
您可以从response['Status']
.
根据get_query_execution
文档:
StateChangeReason (string) -- 有关查询状态的更多详细信息。
import boto3
client = boto3.client('athena')
failed_query_id = '08adbf00-5f14-4d54-9311-fd55e2024781'
response = client.get_query_execution(QueryExecutionId=failed_query_id)
print(response['Status']['StateChangeReason'])
推荐阅读
- stanford-nlp - 使用 NLP 从句子中提取信息
- java - 在java中逐位写入文件
- c# - 在 ASP.NET Core 应用程序中转换为 doc 文件并将 doc 文件附加到电子邮件
- python - 如何使 2 个版本的 Fasttext Python 包装器一起工作?
- python - 类型错误:构造函数返回 NULL
- java - 过滤4列listview android中的数据
- liquibase - 使用 loglevel=debug 在 liquibase 3.6.1 中日志记录不起作用
- python - 无法安装 python adb - M2Crypto 错误
- asp.net-core - Kestrel 和 https 非常慢
- javascript - 带有实例变量的 Refs 给出错误