Amazon web services AWS红移数据API:调用DescripteBatement操作时发生错误(ResourceNotFoundException):查询不存在
几天来,我一直在努力解决最近发布的版本中出现的一个奇怪问题,现在我的头都撞到墙上了。我正在尝试使用在红移集群上执行SQL语句,并使用列出该语句 在本地测试时,API表现良好,我在列出语句时没有问题。然而,在Lambda上部署代码之后,我突然无法找到任何已执行的查询,即使我收到200个execute语句请求的响应 下面是我的CloudWatch日志摘录,其中显示了带有查询ID的execute语句200响应:Amazon web services AWS红移数据API:调用DescripteBatement操作时发生错误(ResourceNotFoundException):查询不存在,amazon-web-services,amazon-redshift,Amazon Web Services,Amazon Redshift,几天来,我一直在努力解决最近发布的版本中出现的一个奇怪问题,现在我的头都撞到墙上了。我正在尝试使用在红移集群上执行SQL语句,并使用列出该语句 在本地测试时,API表现良好,我在列出语句时没有问题。然而,在Lambda上部署代码之后,我突然无法找到任何已执行的查询,即使我收到200个execute语句请求的响应 下面是我的CloudWatch日志摘录,其中显示了带有查询ID的execute语句200响应: { "level": "INFO", "
{
"level": "INFO",
"location": "execute_asynchronous_sql_query:71",
"message": {
"message": "Successfully submitted sql query to redshift cluster",
"query_id": "706a0ca1-084c-4733-a534-571993afd23a",
"execution_statement_response": {
"ClusterIdentifier": "#######",
"CreatedAt": "2021-01-15 06:00:37.504000+00:00",
"Database": "#######",
"Id": "706a0ca1-084c-4733-a534-571993afd23a",
"SecretArn": "arn:aws:secretsmanager:##############",
"ResponseMetadata": {
"RequestId": "#######",
"HTTPStatusCode": 200,
"HTTPHeaders": {
"x-amzn-requestid": "#######",
"content-type": "application/x-amz-json-1.1",
"content-length": "237",
"date": "Fri, 15 Jan 2021 06:00:38 GMT"
},
"RetryAttempts": 0
},
"StatementName": "ww-redshift-asynch-2021-01-15T06:00:37.206308-summary_spots.sql"
}
},
"timestamp": "2021-01-15 06:00:38,008",
"service": "ww_dashboard",
"sampling_rate": 0,
"sample_rate": 0.4,
"xray_trace_id": "##############"
}
下面是我在尝试使用带有该查询ID的AWS cli时遇到的错误
aws redshift-data describe-statement --id 706a0ca1-084c-4733-a534-571993afd23a
An error occurred (ResourceNotFoundException) when calling the DescribeStatement operation: Query does not exist.
执行
描述语句
或获取语句结果
的角色/用户需要与执行语句的角色/用户相同
另外,需要在同一地区。谢谢@fei,有相关文件吗?