Amazon web services 如何通过boto3获得对雅典娜的查询错误?

Amazon web services 如何通过boto3获得对雅典娜的查询错误?,amazon-web-services,boto3,amazon-athena,Amazon Web Services,Boto3,Amazon Athena,boto3是否有任何方法可以在查询失败时获取错误文本get\u query\u execution仅返回查询的状态。您可以从响应['status']的'StateChangeReason'字段中获取错误消息 根据文件: StateChangeReason(字符串)-- 有关查询状态的更多详细信息 您可以从响应['Status']的'StateChangeReason'字段中获取错误消息 根据文件: StateChangeReason(字符串)-- 有关查询状态的更多详细信息 import bot

boto3是否有任何方法可以在查询失败时获取错误文本
get\u query\u execution
仅返回查询的状态。

您可以从
响应['status']的
'StateChangeReason'
字段中获取错误消息

根据文件:

StateChangeReason(字符串)-- 有关查询状态的更多详细信息


您可以从
响应['Status']
'StateChangeReason'
字段中获取错误消息

根据文件:

StateChangeReason(字符串)-- 有关查询状态的更多详细信息

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'])