

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 对亚马逊 Athena 中的查询进行疑难解答
<a name="querying-troubleshoot"></a>

使用以下信息可帮助您诊断和修复您在使用 Athena 查询存储在 Security Lake S3 存储桶中的对象时可能遇到的常见问题。有关更多 Athena 故障排除主题，请参阅 *Amazon Athena 用户指南*的[在 Athena 中进行故障排除](https://docs.aws.amazon.com/athena/latest/ug/troubleshooting-athena.html)部分。

## 查询未返回数据湖中的新对象
<a name="query-not-returning-objects"></a>

即使 Security Lake 的 S3 存储桶中包含新对象，您的 Athena 查询也可能不会返回数据湖中的这些对象。如果您禁用了 Security Lake 然后又将其启用，则可能会发生这种情况。因此， AWS Glue 分区可能无法正确注册新对象。

要纠正此错误，请按照以下步骤操作：

1. 打开 AWS Lambda 控制台，网址为[https://console.aws.amazon.com/lambda/](https://console.aws.amazon.com/lambda/)。

1. 在导航栏的“区域”选择器上，选择已启用 Security Lake 但 Athena 查询未返回结果的区域。

1. **从导航窗格中选择 Functions，然后根据源版本从以下列表中选择函数：**
   + `Source version 1 (OCSF 1.0.0-rc.2) `— **SecurityLake\$1glue\$1Partition\$1Updater\$1 *≪region>*** Lambda\$1 函数。
   + `Source version 2 (OCSF 1.1.0)`— **AmazonSecurityLakeMetastoreManager\$1 *≪region>*** 函数。

1. 在**配置**选项卡中，选择**触发器**。

1. 选择函数旁边的选项，然后选择**编辑**。

1. 选择**激活触发器**，然后选择**保存**。函数状态会变为**已启用**。

## 无法访问 AWS Glue 表
<a name="access-glue-tables"></a>

查询访问订阅者可能无法访问包含 Security Lake 数据的 AWS Glue 表。

首先，请确保您已执行[设置跨账户表共享（订阅用户步骤）](create-query-subscriber-procedures.md#grant-query-access-subscriber)中的步骤。

如果订阅用户仍然无法访问，请按照以下步骤操作：

1. 打开 AWS Glue 控制台，网址为[https://console.aws.amazon.com/glue/](https://console.aws.amazon.com/glue/)。

1. 在导航窗格中选择**数据目录**，然后选择**目录设置**。

1. 使用基于资源的策略向订阅者授予访问 AWS Glue 表的权限。有关创建基于资源的策略的更多信息，请参阅 *AWS Glue 开发人员指南*中的[适用于 AWS Glue的基于资源的策略示例](https://docs.aws.amazon.com/glue/latest/dg/security_iam_resource-based-policy-examples.html)。