

# 在 Athena 中进行排查问题
<a name="troubleshooting-athena"></a>

Athena 团队从客户问题中收集了以下故障排除信息。虽然并不全面，但它包括有关一些常见性能、超时和内存不足问题的建议。

**Topics**
+ [CREATE TABLE AS SELECT (CTAS)](#troubleshooting-athena-create-table-as-select-ctas)
+ [数据文件问题](#troubleshooting-athena-data-file-issues)
+ [Linux Foundation Delta Lake 表](#troubleshooting-athena-delta-lake-tables)
+ [联合查询](#troubleshooting-athena-federated-queries)
+ [JSON 相关错误](#troubleshooting-athena-json-related-errors)
+ [MSCK REPAIR TABLE](#troubleshooting-athena-msck-repair-table)
+ [输出问题](#troubleshooting-athena-output-issues)
+ [Parquet 问题](#troubleshooting-athena-parquet-issues)
+ [分区问题](#troubleshooting-athena-partitioning-issues)
+ [权限](#troubleshooting-athena-permissions)
+ [查询语法问题](#troubleshooting-athena-query-syntax-issues)
+ [查询超时问题](#troubleshooting-athena-query-timeout-issues)
+ [节流问题](#troubleshooting-athena-throttling-issues)
+ [视图](#troubleshooting-athena-views)
+ [工作组](#troubleshooting-athena-workgroups)
+ [其他资源](#troubleshooting-athena-additional-resources)
+ [Athena 错误目录](error-reference.md)

## CREATE TABLE AS SELECT (CTAS)
<a name="troubleshooting-athena-create-table-as-select-ctas"></a>

### 重复的数据与并发 CTAS 语句一起出现
<a name="troubleshooting-athena-duplicated-data-occurs-with-concurrent-ctas-statements"></a>

Athena 不维护 CTAS 的并发验证。确保同一位置不会同时出现重复的 CTAS 语句。即使 CTAS 或 INSERT INTO 语句失败，孤立数据也可以保留在语句中指定的数据位置。

### HIVE\$1TOO\$1MANY\$1OPEN\$1PARTITIONS
<a name="troubleshooting-athena-ctas-hive-too-many-open-partitions"></a>

当您使用 CTAS 语句来创建包含超过 100 个分区的表时，可能会收到错误消息则可能会收到错误消息 HIVE\$1TOO\$1MANY\$1OPEN\$1PARTITIONS: Exceeded limit of 100 open writers for partitions/buckets（HIVE\$1TOO\$1MANY\$1OPEN\$1PARTISS：分区/存储桶超过 100 个打开的写入程序限制）。要绕过此限制，您可以使用一个 CTAS 语句和一系列 `INSERT INTO` 语句，每个后一种语句将创建或插入不超过 100 个分区。有关更多信息，请参阅 [使用 CTAS 和 INSERT INTO 绕过 100 分区限制](ctas-insert-into.md)。

## 数据文件问题
<a name="troubleshooting-athena-data-file-issues"></a>

### Athena 无法读取隐藏的文件
<a name="troubleshooting-athena-athena-cannot-read-hidden-files"></a>

Athena 将以下划线 (\$1) 或句点 (.) 开头的源文件视为隐藏文件。要解决此限制，请重命名文件。

### Athena 读取我从 AWS Glue 爬网程序中排除的文件
<a name="troubleshooting-athena-athena-reads-files-that-i-excluded-from-the-glue-crawler"></a>

Athena 不承认您为 AWS Glue 爬网程序指定的[排除模式](https://docs.aws.amazon.com/glue/latest/dg/define-crawler.html#crawler-data-stores-exclude)。例如，如果您有一个 Amazon S3 存储桶，其中包含 `.csv` 和 `.json` 文件，并且您从爬网程序中排除了 `.json` 文件时，Athena 会查询两组文件。要避免这种情况，请将要排除的文件放置在其他位置。

### HIVE\$1BAD\$1DATA：分析字段值时出错
<a name="troubleshooting-athena-hive_bad_data-error-parsing-field-value"></a>

以下情况下可能会出现此错误：
+ 表中定义的数据类型与源数据不匹配，或者单个字段包含不同类型的数据。有关建议的分辨率，请参阅 AWS 知识中心的 [我的 Amazon Athena 查询失败，出现错误“HIVE\$1BAD\$1DATA: Error parsing field value for field X: For input string: "12312845691"（HIVE\$1BAD\$1DATA：分析 x 字段值时出错：输入字符串：“12312845691”）”](https://aws.amazon.com/premiumsupport/knowledge-center/athena-hive-bad-data-parsing-field-value/)。
+ 空值存在于整数字段中。一种解决方法是创建带有空值为 `string` 的列，然后使用 `CAST` 转换查询中的字段，为空值提供 `0` 的默认值。有关更多信息，请参阅 AWS 知识中心的 [当我在 Athena 中查询 CSV 数据时，出现错误“HIVE\$1BAD\$1DATA: Error parsing field value '' for field X: For input string: ""（HIVE\$1BAD\$1DATA：分析 X 字段''值时出错：输入字符串：“”）”](https://aws.amazon.com/premiumsupport/knowledge-center/athena-hive-bad-data-error-csv/)。

### HIVE\$1CANNOT\$1OPEN\$1SPLIT：打开 Hive split s3://amzn-s3-demo-bucket 时出错
<a name="troubleshooting-athena-hive_cannot_open_split-error-opening-hive-split-s3bucket-name"></a>

当您查询具有大量对象的 Amazon S3 存储桶前缀时，可能会发生此错误。有关更多信息，请参阅 AWS 知识中心的[如何解决 Athena 中的“HIVE\$1CANNOT\$1OPEN\$1SPLIT：打开 s3://amzn-s3-demo-bucket/ 时出错：减速”错误？](https://aws.amazon.com/premiumsupport/knowledge-center/hive-cannot-open-split-503-athena/)。

### HIVE\$1CURSOR\$1ERROR: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist
<a name="troubleshooting-athena-hive_cursor_error-com.amazonaws.services.s3.model.amazons3exception-the-specified-key-does-not-exist"></a>

当查询正在运行而删除文件时，通常会发生此错误。您可重新运行查询，或检查您的工作流，以查看查询运行时是否有另一个任务或进程正在修改文件。

### HIVE\$1CURSOR\$1ERROR：输入流式传输意外结束
<a name="troubleshooting-athena-hive_cursor_error-unexpected-end-of-input-stream"></a>

此消息表示该文件已损坏或为空。检查文件的完整性，然后重启查询。

### HIVE\$1FILESYSTEM\$1ERROR: Incorrect fileSize *1234567* for file（HIVE\$1FILESSTEM\$1ERROR：文件的文件大小错误 1234567）
<a name="troubleshooting-athena-hive_filesystem_error-incorrect-file-size"></a>

文件在查询规划和查询执行之间更改时，可能会出现此消息。Amazon S3 上的文件被就地替换（例如，`PUT` 在对象已存在的密钥上执行）时，通常会出现此消息。运行查询时，Athena 不支持删除或替换文件内容。为避免此错误，请在查询不运行时安排覆盖或删除文件的任务，或者只将数据写入新文件或分区。

### HIVE\$1UNKNOWN\$1ERROR：无法创建输入格式
<a name="troubleshooting-athena-hive_unknown_error-unable-to-create-input-format"></a>

此错误可能是由类似于以下的问题导致的：
+ AWS Glue 爬网程序无法对数据格式进行分类
+ 某些 AWS Glue 表定义属性为空
+ Athena 不支持 Amazon S3 中文件的数据格式

有关更多信息，请参阅 AWS 知识中心的[如何解决 Athena 中的“无法创建输入格式”错误？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-unable-to-create-input-format/)或观看知识中心[视频](https://www.youtube.com/watch?v=CGzXW3hRa8g)。

### 为保存查询结果而提供的 S3 位置无效。
<a name="troubleshooting-athena-the-s3-location-provided-to-save-your-query-results-is-invalid."></a>

确保您为查询结果指定了有效的 S3 位置。有关更多信息，请参阅[使用查询结果和最近查询](querying.md)主题中的 [指定查询结果位置](query-results-specify-location.md)。

## Linux Foundation Delta Lake 表
<a name="troubleshooting-athena-delta-lake-tables"></a>

### Delta Lake 表架构不同步
<a name="troubleshooting-athena-delta-lake-table-schema-out-of-sync"></a>

如果您查询的 Delta Lake 表在 AWS Glue 中的架构已过时，可能会收到以下错误消息：

```
INVALID_GLUE_SCHEMA: Delta Lake table schema in Glue does not match the most recent schema of the 
Delta Lake transaction log. Please ensure that you have the correct schema defined in Glue.
```

如果在将架构添加到 Athena 之后在 AWS Glue 中对其进行了修改，架构可能会过时。要更新架构，请执行以下任一步骤：
+ 在 AWS Glue 中运行 [AWS Glue 爬网程序](https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html)。
+ 在 Athena 中，[删除表](drop-table.md)并重新[创建](create-table.md)。
+ 手动添加缺失的列，方法可以是在 Athena 中使用 [ALTER TABLE ADD COLUMNS](alter-table-add-columns.md) 语句，也可以是[在 AWS Glue 中编辑表架构](https://docs.aws.amazon.com/glue/latest/dg/console-tables.html#console-tables-details)。

## 联合查询
<a name="troubleshooting-athena-federated-queries"></a>

### 调用 ListTableMetadata 时超时
<a name="troubleshooting-athena-federated-queries-list-table-metadata-timeout"></a>

如果数据来源中有很多表、数据来源运行缓慢或网络运行缓慢，则对 [ListTableMetadata](https://docs.aws.amazon.com/athena/latest/APIReference/API_ListTableMetadata.html) API 的调用可能会超时。要解决此问题，请执行以下步骤。
+ **检查表的数量** – 如果您有 1000 多个表，请尝试减少表的数量。为了获得最快的 `ListTableMetadata` 响应，我们建议每个目录的表数少于 1000 个。
+ **检查 Lambda 配置** - 监控 Lambda 函数行为至关重要。使用联合目录时，请务必检查 Lambda 函数的执行日志。根据结果，相应地调整内存和超时值。要确定任何潜在的超时问题，请重访您的 Lambda 配置。有关更多信息，请参阅《AWS Lambda 开发人员指南》**中的[配置函数超时（控制台）](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-timeout-console)。
+ **检查联合数据来源日志** - 检查来自联合数据来源的日志和错误消息，以查看是否存在任何问题或错误。这些日志可以提供有关超时原因的有用见解。
+ **使用 `StartQueryExecution` 提取元数据** – 如果您有 1000 多个表，则使用联合连接器检索元数据所需的时间可能会超出预期。由于 [StartQueryExecution](https://docs.aws.amazon.com/athena/latest/APIReference/API_StartQueryExecution.html) 的异步性质可确保 Athena 以最佳方式运行查询，因此可以考虑使用 `StartQueryExecution` 作为 `ListTableMetadata` 的替代方案。以下 AWS CLI 示例说明如何使用 `StartQueryExecution`（而非 `ListTableMetadata`）来获取数据目录中表的所有元数据。

  首先，运行一个查询来获取所有表，如下例所示。

  ```
  aws athena start-query-execution --region us-east-1 \
  --query-string "SELECT table_name FROM information_schema.tables LIMIT 50" \
  --work-group "your-work-group-name"
  ```

  其次，检索单个表的元数据，如下例所示。

  ```
  aws athena start-query-execution --region us-east-1 \
  --query-string "SELECT * FROM information_schema.columns \
  WHERE table_name = 'your-table-name' AND \
  table_catalog = 'your-catalog-name'" \
  --work-group "your-work-group-name"
  ```

  获取结果所需的时间取决于目录中表的数量。

有关联合查询故障排除的更多信息，请参阅 GitHub 上 awslabs/aws-athena-query-federation 部分中的[常见问题](https://github.com/awslabs/aws-athena-query-federation/wiki/Common_Problems)，或参阅各个 [Athena 数据来源连接器](connectors-available.md)的文档。

## JSON 相关错误
<a name="troubleshooting-athena-json-related-errors"></a>

### 尝试读取 JSON 数据时出现 NULL 或不正确的数据错误
<a name="troubleshooting-athena-null-or-incorrect-data-errors-when-trying-to-read-json-data"></a>

当您尝试读取 JSON 数据时，NULL 或不正确的数据错误可能是由于多种原因造成的。要识别在使用 OpenX SerDE 时导致错误的行，请将 `ignore.malformed.json` 设置为 `true`。格式错误的记录将返回为 NULL。有关更多信息，请参阅 AWS 知识中心的[我在 Amazon Athena 中尝试读取 JSON 数据时收到错误](https://aws.amazon.com/premiumsupport/knowledge-center/error-json-athena/)观看知识中心[视频](https://youtu.be/ME7Pv1qPFLM)。

### HIVE\$1BAD\$1DATA: Error parsing field value for field 0: java.lang.String cannot be cast to org.openx.data.jsonserde.json.JSONObject
<a name="troubleshooting-athena-hive-bad-data-openx-json-serde"></a>

当 [OpenX JSON SerDe](openx-json-serde.md) 无法解析 Athena 查询中的列时，就会引发此错误。如果您将列定义为 `map` 或者 `struct`，但基础数据实际上是 `string`、`int` 或其他基本类型，就会出现这种状况。

### HIVE\$1CURSOR\$1ERROR: Row is not a valid JSON Object - JSONException: Duplicate key（HIVE\$1CURSOR\$1ERROR：行不是有效的 JSON 对象 - JSONException：重复的键）
<a name="troubleshooting-athena-hive_cursor_error-row-is-not-a-valid-json-object---jsonexception-duplicate-key"></a>

当您使用 Athena 查询拥有多个同名标签，但大小写不同的 AWS Config 资源时，会出现此错误。解决方案是使用 `WITH SERDEPROPERTIES 'case.insensitive'='false'` 运行 `CREATE TABLE` 并映射名称。有关 `case.insensitive` 和映射的更多信息，请参阅 [JSON SerDe 库](json-serde.md)。有关更多信息，请参阅 AWS 知识中心中的 [当在 Athena 中读取来自 AWS Config 的文件时，如何解决“HIVE\$1CURSOR\$1ERROR: Row is not a valid JSON Object - JSONException: Duplicate key（HIVE\$1CURSOR\$1ERROR：行不是有效的 JSON 对象 - JSONException：重复的键）”？](https://aws.amazon.com/premiumsupport/knowledge-center/json-duplicate-key-error-athena-config/)

### 美观打印的 JSON 文本的 HIVE\$1CURSOR\$1ERROR 消息
<a name="troubleshooting-athena-json-serde-hive-cursor-error"></a>

[Hive JSON SerDe](hive-json-serde.md) 和 [OpenX JSON SerDe](openx-json-serde.md) 库期望每个 JSON 文档都位于单行文本中，并且不使用行终止字符分隔记录中的字段。如果 JSON 文本采用美观的打印格式，当您在创建表后尝试对其进行查询时，可能会收到类似以下内容的错误消息：HIVE\$1CURSOR\$1ERROR: Row is not a valid JSON Object（HIVE\$1CURSOR\$1ERROR：行不是有效的 JSON 对象）或 HIVE\$1CURSOR\$1ERROR: JsonParseException: Unexpected end-of-input: expected close marker for OBJECT（HIVE\$1CURSOR\$1ERROR：JsonParseException：意外的输入结束：对象的预期关闭标记）。有关更多信息，请参阅 GitHub 上 OpenX SerDe 文档中的 [JSON data files](https://github.com/rcongiu/Hive-JSON-Serde#json-data-files)（JSON 数据文件）。

### 多个 JSON 记录返回的 SELECT COUNT 为 1
<a name="troubleshooting-athena-multiple-json-records-return-a-select-count-of-1"></a>

如果您使用的是 [OpenX JSON SerDe](openx-json-serde.md)，请确保记录由换行符分隔。有关更多信息，请参阅 AWS 知识中心中的[即使输入 JSON 文件有多条记录，Amazon Athena 中的 SELECT COUNT 查询也仅返回一条记录](https://aws.amazon.com/premiumsupport/knowledge-center/select-count-query-athena-json-records/)。

### 无法查询由使用自定义 JSON 分类器的 AWS Glue 爬网程序创建的表
<a name="troubleshooting-athena-cannot-query-a-table-created-by-a-glue-crawler-that-uses-a-custom-json-classifier"></a>

Athena 引擎不支持[自定义 JSON 分类器](https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json)。要解决此问题，请创建不含自定义分类器的新表。要转换 JSON，您可以使用 CTAS 或创建视图。例如，如果您正在使用数组，则可以使用 UNNEST 选项来拼合 JSON。另一个选择是使用支持自定义分类器的 AWS Glue ETL 任务，在 Amazon S3 中将数据转换为 Parquet，然后在 Athena 中查询它。

## MSCK REPAIR TABLE
<a name="troubleshooting-athena-msck-repair-table"></a>

有关 MSCK REPAIR TABLE 相关问题的信息，请参阅 [MSCK REPAIR TABLE](msck-repair-table.md) 页面的 [注意事项和限制](msck-repair-table.md#msck-repair-table-considerations) 和 [问题排查](msck-repair-table.md#msck-repair-table-troubleshooting) 的部分。

## 输出问题
<a name="troubleshooting-athena-output-issues"></a>

### 无法验证/创建输出存储桶
<a name="troubleshooting-athena-unable-to-verifycreate-output-bucket"></a>

如果指定的查询结果位置不存在或不存在适当的权限，则可能会发生此错误。有关更多信息，请参阅 AWS 知识中心的 [如何解决 Amazon Athena 中的“unable to verify/create output bucket（无法验证/创建输出存储桶）”错误？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-output-bucket-error/)

### TIMESTAMP 结果为空
<a name="troubleshooting-athena-timestamp-result-is-empty"></a>

Athena 需要 Java TIMESTAMP 格式。有关更多信息，请参阅 AWS 知识中心中[当我在 Amazon Athena 中查询表时，TIMESTAMP 结果为空](https://aws.amazon.com/premiumsupport/knowledge-center/query-table-athena-timestamp-empty/)。

### 以 CSV 以外的格式存储 Athena 查询输出
<a name="troubleshooting-athena-store-athena-query-output-in-a-format-other-than-csv"></a>

默认情况下，Athena 仅以 CSV 格式输出文件。若要输出采用其他格式的 `SELECT` 查询结果，可以使用 `UNLOAD` 语句。有关更多信息，请参阅 [UNLOAD](unload.md)。您还可以使用 CTAS 查询，该查询使用 [`format` 表属性](create-table-as.md#ctas-table-properties)配置输出格式。与 `UNLOAD` 不同，CTAS 技术需要创建表格。有关更多信息，请参阅 AWS 知识中心中的[如何以 CSV 以外的格式（如压缩格式）存储 Athena 查询输出？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-query-output-different-format/)。

### 为保存查询结果而提供的 S3 位置无效
<a name="troubleshooting-athena-the-s3-location-provided-to-save-your-query-results-is-invalid"></a>

如果您的输出存储桶位置与运行查询的区域不一致，则可能会收到此错误消息。要避免这种情况，请在运行查询的区域中指定查询结果位置。要查看步骤，请参阅 [指定查询结果位置](query-results-specify-location.md)。

## Parquet 问题
<a name="troubleshooting-athena-parquet-issues"></a>

### org.apache.parquet.io.GroupColumnIO cannot be cast to org.apache.parquet.io.PrimitiveColumnIO
<a name="troubleshooting-athena-org.apache.parquet.io.groupcolumnio-cannot-be-cast-to-org.apache.parquet.io.primitivecolumnio"></a>

此错误是由 parquet 架构不匹配引起的。具有非基本类型的列（例如，`array`）在 AWS Glue 中被声明为原始类型（例如，`string`）。若要解决此问题，请检查文件中的数据架构，并将其与 AWS Glue 中声明的架构相比较。

### Parquet 统计数据问题
<a name="troubleshooting-athena-parquet-statistics-issues"></a>

当读取 Parquet 数据时，您可能会收到如下错误消息：

```
HIVE_CANNOT_OPEN_SPLIT: Index x out of bounds for length y
HIVE_CURSOR_ERROR: Failed to read x bytes
HIVE_CURSOR_ERROR: FailureException at Malformed input: offset=x
HIVE_CURSOR_ERROR: FailureException at java.io.IOException: 
can not read class org.apache.parquet.format.PageHeader: Socket is closed by peer.
```

要解决此问题，请使用 [CREATE TABLE](create-table.md) 或 [ALTER TABLE SET TBLPROPERTIES](alter-table-set-tblproperties.md) 语句将 Parquet Serde `parquet.ignore.statistics` 属性设置为 `true`，如以下示例所示。

CREATE TABLE 示例

```
...
ROW FORMAT SERDE  
'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
WITH SERDEPROPERTIES ('parquet.ignore.statistics'='true')  
STORED AS PARQUET 
...
```

ALTER TABLE 示例

```
ALTER TABLE ... SET TBLPROPERTIES ('parquet.ignore.statistics'='true')
```

有关 Parquet Hive SerDe 的更多信息，请参阅 [Parquet SerDe](parquet-serde.md)。

## 分区问题
<a name="troubleshooting-athena-partitioning-issues"></a>

### MSCK REPAIR TABLE 不会删除过时的分区
<a name="troubleshooting-athena-msck-repair-table-does-not-remove-stale-partitions"></a>

如果您在 Amazon S3 中手动删除分区，然后运行 MSCK REPAIR TABLE，您可能会收到错误消息文件系统中缺少分区。发生这种情况的原因是 MSCK REPAIR TABLE 不会从表元数据中删除过时的分区。请使用 [ALTER TABLE DROP PARTITION](alter-table-drop-partition.md) 手动删除过时的分区。有关更多信息，请参阅 [MSCK REPAIR TABLE](msck-repair-table.md) 主题的“疑难解答”部分。

### MSCK REPAIR TABLE 故障
<a name="troubleshooting-athena-msck-repair-table-failure"></a>

当大量的分区（例如，超过 100,000 个）与特定表相关联时，`MSCK REPAIR TABLE` 可能会因内存限制而故障。要解决此限制，请换成 [ALTER TABLE ADD PARTITION](alter-table-add-partition.md)。

### MSCK REPAIR TABLE 检测到分区，但未将它们添加到 AWS Glue
<a name="troubleshooting-athena-msck-repair-table-detects-partitions-but-doesnt-add-them-to-glue"></a>

如果 Amazon S3 路径混合使用大小写而不是全小写，或者 IAM 策略不允许 `glue:BatchCreatePartition` 操作，则会出现此问题。有关更多信息，请参阅 AWS 知识中心的 [MSCK REPAIR TABLE 检测到 Athena 中的分区，但未将它们添加到 AWS Glue Data Catalog](https://aws.amazon.com/premiumsupport/knowledge-center/athena-aws-glue-msck-repair-table/)。

### 日期格式为 dd-MM-yyyy-HH-mm-ss 或 yyyy-MM-dd 的分区投影范围不起作用
<a name="troubleshooting-athena-partition-projection-ranges-with-the-date-format-of-dd-mm-yyyy-hh-mm-ss-or-yyyy-mm-dd-do-not-work"></a>

要正常工作，必须将日期格式设置为 `yyyy-MM-dd HH:00:00`。有关更多信息，请参阅 Stack Overflow 文章：[Athena partition projection not working as expected](https://stackoverflow.com/questions/63943920/athena-partition-projection-not-working-as-expected)（Athena 分区投影无法按预期工作）。

### PARTITION BY 不支持 BIGINT 类型
<a name="troubleshooting-athena-partition-by-doesnt-support-the-bigint-type"></a>

将数据类型转换为 `string`，然后重试。

### 没有可用的有意义分区
<a name="troubleshooting-athena-no-meaningful-partitions-available"></a>

此错误消息通常意味着分区设置已损坏。若要解决此问题，请删除该表并创建具有新分区的表。

### 分区投影不能与范围分区结合使用
<a name="troubleshooting-athena-partition-projection-does-not-work-in-conjunction-with-range-partitions"></a>

检查时间范围单位[projection.*<columnName>*.interval.unit](partition-projection-supported-types.md#partition-projection-date-type) 是否匹配分区的分隔符。例如，如果分区按天分隔，则小时范围单位将不起作用。

### 用连字符指定范围时发生分区投影错误
<a name="troubleshooting-athena-partition-projection-range-issue-with-hyphen"></a>

使用连字符而不是逗号来指定 `range` 表属性会产生一个错误，比如 INVALID\$1TABLE\$1PROPERTY: For input string: "*number*-*number*"。确保使用逗号来分隔范围值，而不是使用连字符。有关更多信息，请参阅 [整数类型](partition-projection-supported-types.md#partition-projection-integer-type)。

### HIVE\$1UNKNOWN\$1ERROR：无法创建输入格式
<a name="troubleshooting-athena-hive_unknown_error-unable-to-create-input-format-1"></a>

一个或多个 Glue 分区以不同的格式声明，因为每个 Glue 分区都有自己的特定输入格式。请检查您的分区是如何在 AWS Glue 中定义的。

### HIVE\$1PARTITION\$1SCHEMA\$1MISMATCH
<a name="troubleshooting-athena-hive_partition_schema_mismatch"></a>

如果分区的架构与表的架构不同，则查询可能会失败，并显示错误消息：HIVE\$1PARTITION\$1SCHEMA\$1MISMATCH。

对 AWS Glue Data Catalog 中每个具有分区列的表，架构都在表级别并且针对表中的每个单独分区存储。分区的架构由 AWS Glue 爬网程序根据它在分区中读取的数据样本进行填充。

当 Athena 运行查询时，它会验证表的架构和查询所需的任何分区的架构。验证会将列数据类型按顺序进行比较，确保它们对于重叠的列匹配。这可防止意外的操作，例如在表的中间添加或删除列。如果 Athena 检测到分区的架构与表的架构不同，则 Athena 可能无法处理查询，会因 `HIVE_PARTITION_SCHEMA_MISMATCH` 而失败。

可通过几种方式解决此问题。首先，如果意外添加了数据，您可以删除导致架构差异的数据文件，删除该分区，然后重新爬取数据。其次，您可以删除单个分区，然后在 Athena 中运行 `MSCK REPAIR`，以使用表的架构重新创建分区。只有当您确信应用的架构将继续正确读取数据时，此第二个选项才有效。

### SemanticException 表未进行分区，但存在分区规范
<a name="troubleshooting-athena-semanticexception-table-is-not-partitioned-but-partition-spec-exists"></a>

如果 `CREATE TABLE` 语句中没有定义分区，则会发生此错误。有关更多信息，请参阅 AWS 知识中心的[如何解决 Athena 中的错误“失败：SemanticException 表未进行分区，但存在分区规范”？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-failed-semanticexception-table/)。

### 零字节 `_$folder$` 文件
<a name="troubleshooting-athena-alter-table-add-partition-zero-byte-folder-files"></a>

如果您运行 `ALTER TABLE ADD PARTITION` 语句并错误地指定了已存在的分区和错误的 Simple Storage Service (Amazon S3) 位置，格式为 `partition_value_$folder$` 的零字节占位符文件将在 Simple Storage Service (Amazon S3) 中创建。您必须手动移除这些文件。

为了防止这种情况发生，请在 `ALTER TABLE ADD PARTITION` 语句中使用 `ADD IF NOT EXISTS` 语法，像这样：

```
ALTER TABLE table_name ADD IF NOT EXISTS PARTITIION […]
```

### 从分区数据返回零条记录
<a name="troubleshooting-athena-zero-records-returned-from-partitioned-data"></a>

此问题可能由于多个原因引发。有关可能的原因和解决方案，请参阅 AWS 知识中心的[我在 Amazon Athena 中创建了一个具有定义分区的表，但是当我查询表时，返回零条记录](https://aws.amazon.com/premiumsupport/knowledge-center/athena-empty-results/)。

另请参阅[HIVE\$1TOO\$1MANY\$1OPEN\$1PARTITIONS](#troubleshooting-athena-ctas-hive-too-many-open-partitions)。

## 权限
<a name="troubleshooting-athena-permissions"></a>

### 查询 Amazon S3 时的访问被拒绝错误
<a name="troubleshooting-athena-access-denied-error-when-querying-amazon-s3"></a>

当您没有读取存储桶中数据的权限、写入结果存储桶的权限或 Amazon S3 路径包含区域端点（如 `us-east-1.amazonaws.com`）时，则可能出现此错误。有关更多信息，请参阅 AWS 知识中心的 [当我运行 Athena 查询时，出现“access denied（访问被拒绝）”错误](https://aws.amazon.com/premiumsupport/knowledge-center/access-denied-athena/)。

### 对 Amazon S3 中的加密数据运行 DDL 查询时出现 Access denied with status code: 403（访问被拒绝，状态代码：403）错误
<a name="troubleshooting-athena-access-denied-error-when-querying-amazon-s3-encrypted"></a>

如果满足以下条件，则您可能会收到错误消息访问被拒绝（服务：Amazon S3；状态代码：403；错误代码：AccessDenied；请求 ID：*<request\$1id>*）：

1. 您运行了一个 DDL 查询，如 `ALTER TABLE ADD PARTITION` 或者 `MSCK REPAIR TABLE`。

1. 您的存储桶配置了[默认加密](https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-bucket-encryption.html)，并使用 `SSE-S3`。

1. 存储桶还具有类似以下内容的存储桶策略，该策略强制 `PutObject` 请求指定 `PUT` 标题 `"s3:x-amz-server-side-encryption": "true"` 和 `"s3:x-amz-server-side-encryption": "AES256"`。

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Effect": "Deny",
               "Principal": "*",
               "Action": "s3:PutObject",
               "Resource": "arn:aws:s3:::<resource-name>/*",
               "Condition": {
                   "Null": {
                       "s3:x-amz-server-side-encryption": "true"
                   }
               }
           },
           {
               "Effect": "Deny",
               "Principal": "*",
               "Action": "s3:PutObject",
               "Resource": "arn:aws:s3:::<resource-name>/*",
               "Condition": {
                   "StringNotEquals": {
                       "s3:x-amz-server-side-encryption": "AES256"
                   }
               }
           }
       ]
   }
   ```

------

在这种情况下，建议的解决方案是删除上述存储桶策略，因为存储桶的默认加密已经存在。

### 查询另一个账户中的 Amazon S3 存储桶时，出现 Access denied with status code: 403（访问被拒绝，状态代码：403）错误
<a name="troubleshooting-athena-access-denied-with-status-code-403-when-querying-an-amazon-s3-bucket-in-another-account"></a>

尝试查询由另一个 AWS 服务 写入的日志，且第二个账户是存储桶拥有者，但不拥有存储桶中的对象时，可能会出现此错误。有关更多信息，请参阅 AWS 知识中心中的 [在另一个账户中查询存储桶时，收到 Amazon Athena 中的 Amazon S3 异常“access denied with status code: 403（访问被拒绝，状态代码：403）”](https://aws.amazon.com/premiumsupport/knowledge-center/athena-access-denied-status-code-403/)。

### 使用 IAM 角色凭证连接到 Athena JDBC 驱动程序
<a name="troubleshooting-athena-use-IAM-role-credentials-to-connect-to-the-athena-jdbc-driver"></a>

您可以检索角色的临时凭证，以对 [JDBC 与 Athena 的连接](connect-with-jdbc.md)进行身份验证。临时凭证的最大生命周期为 12 小时。有关更多信息，请参阅 AWS 知识中心[在使用 JDBC 驱动程序连接到 Athena 时，如何使用我的 IAM 角色凭证或切换到另一个 IAM 角色？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-iam-jdbc-driver/)。

### 未填充必需的表存储描述符
<a name="troubleshooting-athena-access-denied-table-storage"></a>

尝试查询或查看您无权访问的表时，则可能会出现这种情况。对于这种情况，建议解决方案是通过 AWS Lake Formation 授予对资源的 `DESCRIBE` 和 `SELECT` 权限。如果资源是跨账户共享的，原始资源存在于账户 A 中，而您需要查询账户 B 中的关联资源，则必须确保您的角色拥有账户 A 中原始资源的 `DESCRIBE` 权限，并且拥有账户 B 中关联资源的 `SELECT` 权限。

## 查询语法问题
<a name="troubleshooting-athena-query-syntax-issues"></a>

### 失败：NullPointerException 名称为空
<a name="troubleshooting-athena-nullpointerexception-name-is-null"></a>

如果您将 AWS Glue [CreateTable](https://docs.aws.amazon.com/glue/latest/webapi/API_CreateTable.html) API 操作或 CloudFormation [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-table.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-table.html) 模板创建用于 Athena 的表，而不指定 `TableType` 属性，然后运行 DDL 查询，如 `SHOW CREATE TABLE` 或者 `MSCK REPAIR TABLE`，则您将收到错误消息失败：NullPointerException 名称为空。

要纠正该错误，请为 [TableInput](https://docs.aws.amazon.com/glue/latest/webapi/API_TableInput.html) `TableType` 属性指定值，使其作为 AWS Glue `CreateTable` API 调用或 [CloudFormation 模板](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html)的一部分。`TableType` 可能的值包括 `EXTERNAL_TABLE` 或 `VIRTUAL_VIEW`。

此要求仅适用于使用 AWS Glue `CreateTable` API 操作或 `AWS::Glue::Table` 模板创建表的情形。如果您适用 DDL 语句或 AWS Glue 爬网程序为 Athena 创建表，则 `TableType` 属性将自动定义。

### 函数未注册
<a name="troubleshooting-athena-function-not-registered"></a>

当您尝试使用 Athena 不支持的函数时，会发生此错误。有关 Athena 支持的函数的列表，请参阅 [Amazon Athena 中的函数](functions.md) 或在查询编辑器中运行 `SHOW FUNCTIONS` 语句。您还可以编写自己的[用户定义函数 (UDF)](querying-udf.md)。有关更多信息，请参阅 AWS 知识中心的[如何解决 Athena 中的“函数未注册”语法错误？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-syntax-function-not-registered/)。

### GENERIC\$1INTERNAL\$1ERROR 异常
<a name="troubleshooting-athena-generic-internal-error"></a>

`GENERIC_INTERNAL_ERROR` 异常可能有各种原因，包括以下原因：
+ **GENERIC\$1INTERNAL\$1ERROR: null** – 在以下任一情况下，您可能会看到此异常：
  + 表定义中列的数据类型与数据集的实际数据类型之间存在架构不匹配。
  + 正在使用不正确的语法运行 `CREATE TABLE AS SELECT` (CTAS) 查询。
+ **GENERIC\$1INTERNAL\$1ERROR: Parent builder is null**（GENERIC\$1INTERNAL\$1ERROR：父生成器为 null）– 查询其列数据类型为 `array` 的表，并且正在使用 OpenCSVSerDe 库时，则可能会看到此异常。OpenCSVSerde 格式不支持 `array` 数据类型。
+ **GENERIC\$1INTERNAL\$1ERROR：值超过 MAX\$1INT** – 使用数据类型 `INT` 定义源数据列，并且源数据列中的某个数值大于 2147483647 时，您可能会看到此异常。
+ **GENERIC\$1INTERNAL\$1ERROR：值超过 MAX\$1BYTE** – 当源数据列的某个数值超过数据类型 `BYTE` 允许的大小时，您可能会看到此异常。数据类型 `BYTE` 等同于 `TINYINT`。`TINYINT` 是一个有符号的 8 位整数，采用二进制补码格式，最小值为 -128，最大值为 127。
+ **GENERIC\$1INTERNAL\$1ERROR：分区值的数量与筛选条件的数量不匹配** – 如果 Amazon Simple Storage Service（Amazon S3）数据具有不一致的分区，您可能会看到此异常。在以下任一情况下，均可能存在不一致的分区：
  + Amazon S3 上的分区已更改（例如：添加了新分区）。
  + 表中的分区列数与分区元数据中的分区列数不匹配。

有关其中每个错误的更多详细信息，请参阅 AWS 知识中心中的《[当我在 Amazon Athena 中查询表时，如何解决“GENERIC\$1INTERNAL\$1ERROR”错误？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-generic-internal-error/)》。

### 匹配组的数量与列数不匹配
<a name="troubleshooting-athena-number-of-matching-groups-doesnt-match-the-number-of-columns"></a>

此错误当您在 CREATE TABLE 语句中使用 [Regex SerDe](regex-serde.md)，并且正则表达式匹配组的数量与您为表指定的列数不匹配时，会出现此错误。有关更多信息，请参阅 AWS 知识中心中的 [如何解决 Amazon Athena 中的 RegexSerDe 错误“number of matching groups doesn't match the number of columns（匹配组的数量与列数不匹配）”？](https://aws.amazon.com/premiumsupport/knowledge-center/regexserde-error-athena-matching-groups/)。

### queryString 无法满足约束条件：成员的长度必须小于或等于 262144
<a name="troubleshooting-athena-querystring-failed-to-satisfy-constraint-member-must-have-length-less-than-or-equal-to-262144"></a>

Athena 中最大查询字符串长度（262,144 字节）不是可调配额。AWS 支持 无法为您增加配额，但您可以通过将长查询拆分为较小的查询来解决此问题。有关更多信息，请参阅 AWS 知识中心的[如何增加 Athena 中的最大查询字符串长度？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-query-string-length/)。

### SYNTAX\$1ERROR：无法解析列
<a name="troubleshooting-athena-syntax_error-column-cannot-be-resolved"></a>

当您查询由 AWS Glue 爬虫程序从具有字节顺序标记 (BOM) 的 UTF-8 编码 CSV 文件查询表时，会出现此问题。AWS Glue 不会识别 BOM 并会将其更改为问号，Amazon Athena 无法识别这些问号。解决方案是删除 Athena 或 AWS Glue 中的问号。

### 函数调用的参数太多
<a name="troubleshooting-athena-too-many-arguments"></a>

在 Athena 引擎版本 3 中，函数的参数不能超过 127 个。此限制是设计使然。如果您使用的函数参数超过 127 个，则会出现如下错误消息：

TOO\$1MANY\$1ARGUMENTS: line *nnn*:*nn*: 函数调用 *function\$1name*() 的参数太多了。

要解决此问题，请为每次函数调用使用较少的参数。

## 查询超时问题
<a name="troubleshooting-athena-query-timeout-issues"></a>

如果 Athena 查询遇到超时错误，请查看您的 CloudTrail 日志。由于 AWS Glue 或 Lake Formation API 存在节流，查询可能会超时。出现这些错误时，相应的错误消息可能表明是查询超时问题，而不是节流问题。要排查问题，您可以在联系 支持 之前查看自己的 CloudTrail 日志。有关更多信息，请参阅[查询 AWS CloudTrail日志](cloudtrail-logs.md)和[使用 AWS CloudTrail 记录 Amazon Athena API 调用](monitor-with-cloudtrail.md)。

有关调用 `ListTableMetadata` API 时联合查询出现的查询超时问题的信息，请参阅[调用 ListTableMetadata 时超时](#troubleshooting-athena-federated-queries-list-table-metadata-timeout)。

## 节流问题
<a name="troubleshooting-athena-throttling-issues"></a>

如果您的查询超出了依赖服务（如 Amazon S3、AWS KMS、AWS Glue 或者 AWS Lambda）的限制，则可能会出现以下消息。若要解决这些问题，请减少来自同一账户的并发调用的数量。


****  

| 服务 | 错误消息 | 
| --- | --- | 
| AWS Glue | AWSGlueException: Rate exceeded.（AWSGlueException：数量超出限制。） | 
| AWS KMS | 您已超过可以调用 KMS 的数量。请降低您的调用频率。 | 
| AWS Lambda |  Rate exceeded（数量超出限制） TooManyRequestsException  | 
| Amazon S3 | AmazonS3Exception: Please reduce your request rate.（AmazonS3Exception：请降低您的请求率。） | 

有关在使用 Athena 时防止 Amazon S3 节流的方法的信息，请参阅 [防止 Amazon S3 节流](performance-tuning-s3-throttling.md)。

## 视图
<a name="troubleshooting-athena-views"></a>

### 在 Apache Hive shell 中创建的视图在 Athena 中不起作用
<a name="troubleshooting-athena-views-created-in-hive-shell-do-not-work-in-athena"></a>

由于其实现完全不同，在 Apache Hive shell 中创建的视图与 Athena 不兼容。要解决此问题，请在 Athena 中重新创建视图。

### 视图已过时；必须重新创建
<a name="troubleshooting-athena-view-is-stale-it-must-be-re-created"></a>

如果视图下方的表已更改或删除，则可能会收到此错误。解决方法是重新创建视图。有关更多信息，请参阅 AWS 知识中心的 [我怎样才能解决 Athena 中的“view is stale; it must be re-created（视图已过时；必须重新创建）”错误？](https://aws.amazon.com/premiumsupport/knowledge-center/athena-view-is-stale-error/)

## 工作组
<a name="troubleshooting-athena-workgroups"></a>

有关工作组问题排查的更多信息，请参阅 [对工作组错误进行故障排除](workgroups-troubleshooting.md)。

## 其他资源
<a name="troubleshooting-athena-additional-resources"></a>

以下页面提供了有关对 Amazon Athena 问题进行故障排除的其他信息。
+ [Athena 错误目录](error-reference.md)
+ [服务配额](service-limits.md)
+ [Amazon Athena 中 SQL 查询的注意事项和限制](other-notable-limitations.md)
+ [不支持的 DDL](unsupported-ddl.md)
+ [命名数据库、表和列](tables-databases-columns-names.md)
+ [Amazon Athena 中的数据类型](data-types.md)
+ [为您的数据选择 SerDE](supported-serdes.md)
+ [在 Athena 中使用压缩](compression-formats.md)
+ [转义查询中的保留关键字](reserved-words.md)
+ [对工作组错误进行故障排除](workgroups-troubleshooting.md)

以下 AWS 资源也会有所帮助：
+  [AWS 知识中心中的 Athena 主题](https://aws.amazon.com/premiumsupport/knowledge-center/#Amazon_Athena) 
+  [AWS re:Post 上的 Amazon Athena 问题](https://repost.aws/tags/TA78iVOM7gR62_QqDe2-CmiA/amazon-athena)
+  [AWS 大数据博客中的 Athena 文章](https://aws.amazon.com/blogs/big-data/tag/amazon-athena/) 

故障排除通常需要由专家或多个帮助者进行迭代查询和发现。如果尝试此页面上的建议后仍然遇到问题，请联系 AWS 支持 [在 AWS 管理控制台 中，单击 **Support**（支持）、**Support Center**（支持中心）] 或使用 **Amazon Athena** 标签在 [AWS re:Post](https://repost.aws/tags/TA78iVOM7gR62_QqDe2-CmiA/amazon-athena) 上提问。

# Athena 错误目录
<a name="error-reference"></a>

Athena 提供标准化的错误信息，以帮助您了解失败的查询，以及在查询失败发生后采取措施。`AthenaError` 功能包括一个 `ErrorCategory` 字段和一个 `ErrorType` 字段。`ErrorCategory` 说明导致查询失败的原因是系统错误、用户错误还是其他错误。`ErrorType` 提供了有关查询失败原因的更详细信息。结合这两个字段中的信息，可以更好地了解相关情况以及导致出现特定错误的原因。

## 错误类别
<a name="error-reference-error-category"></a>

下表列出了 Athena 错误类别的值及其含义。


****  

| 错误类别 | 来源 | 
| --- | --- | 
| 1 | SYSTEM | 
| 2 | USER | 
| 3 | OTHER | 

## 错误类型参考
<a name="error-reference-error-type-reference"></a>

下表列出了 Athena 错误类型的值及其含义。


****  

| 错误类型 | 描述 | 
| --- | --- | 
| 0 | 查询在此缩放系数耗尽了资源 | 
| 1 | 查询在此缩放系数耗尽了资源 | 
| 2 | 查询在此缩放系数耗尽了资源 | 
| 3 | 查询在此缩放系数耗尽了资源 | 
| 4 | 查询在此缩放系数耗尽了资源 | 
| 5 | 查询在此缩放系数耗尽了资源 | 
| 6 | 查询在此缩放系数耗尽了资源 | 
| 7 | 查询在此缩放系数耗尽了资源 | 
| 8 | 查询在此缩放系数耗尽了资源 | 
| 100 | 内部服务错误 | 
| 200 | 查询引擎出现内部错误 | 
| 201 | 查询引擎出现内部错误 | 
| 202 | 查询引擎出现内部错误 | 
| 203 | 驱动程序错误 | 
| 204 | 元数据仓出现错误 | 
| 205 | 查询引擎出现内部错误 | 
| 206 | 查询超时 | 
| 207 | 查询引擎出现内部错误 | 
| 208 | 查询引擎出现内部错误 | 
| 209 | 未能取消查询 | 
| 210 | 查询超时 | 
| 211 | 查询引擎出现内部错误 | 
| 212 | 查询引擎出现内部错误 | 
| 213 | 查询引擎出现内部错误 | 
| 214 | 查询引擎出现内部错误 | 
| 215 | 查询引擎出现内部错误 | 
| 216 | 查询引擎出现内部错误 | 
| 217 | 查询引擎出现内部错误 | 
| 218 | 查询引擎出现内部错误 | 
| 219 | 查询引擎出现内部错误 | 
| 220 | 查询引擎出现内部错误 | 
| 221 | 查询引擎出现内部错误 | 
| 222 | 查询引擎出现内部错误 | 
| 223 | 查询引擎出现内部错误 | 
| 224 | 查询引擎出现内部错误 | 
| 225 | 查询引擎出现内部错误 | 
| 226 | 查询引擎出现内部错误 | 
| 227 | 查询引擎出现内部错误 | 
| 228 | 查询引擎出现内部错误 | 
| 229 | 查询引擎出现内部错误 | 
| 230 | 查询引擎出现内部错误 | 
| 231 | 查询引擎出现内部错误 | 
| 232 | 查询引擎出现内部错误 | 
| 233K | Iceberg 错误 | 
| 234 | Lake Formation 错误 | 
| 235 | 查询引擎出现内部错误 | 
| 236 | 查询引擎出现内部错误 | 
| 237 | 序列化错误 | 
| 238 | 未能将元数据上载到 Amazon S3 | 
| 239 | 常规持久性错误 | 
| 240 | 未能提交查询 | 
| 300 | 内部服务错误 | 
| 301 | 内部服务错误 | 
| 302 | 内部服务错误 | 
| 303 | 内部服务错误 | 
| 400 | 内部服务错误 | 
| 401 | 未能将查询结果写入 Amazon S3 | 
| 402 | 未能将查询结果写入 Amazon S3 | 
| 1000 | 用户错误 | 
| 1001 | 数据错误 | 
| 1002 | 数据错误 | 
| 1003 | DDL 任务失败 | 
| 1004 | Schema 错误 | 
| 1005 | 序列化错误 | 
| 1006 | 语法错误 | 
| 1007 | 数据错误 | 
| 1008 | 查询被拒绝 | 
| 1009 | 查询失败 | 
| 1010 | 内部服务错误 | 
| 1011 | 查询被用户取消 | 
| 1012 | 查询引擎出现内部错误 | 
| 1013 | 查询引擎出现内部错误 | 
| 1014 | 查询被用户取消 | 
| 1100 | 提供的参数无效 | 
| 1101 | 提供的属性无效 | 
| 1102 | 查询引擎出现内部错误 | 
| 1103 | 提供的表属性无效 | 
| 1104 | 查询引擎出现内部错误 | 
| 1105 | 查询引擎出现内部错误 | 
| 1106 | 提供的函数参数无效 | 
| 1107 | 视图无效 | 
| 1108 | 未能注册函数 | 
| 1109 | 未找到提供的 Amazon S3 路径 | 
| 1110 | 提供的表或视图不存在 | 
| 1200 | 查询不受支持 | 
| 1201 | 提供的解码器不受支持 | 
| 1202 | 查询类型不受支持 | 
| 1300 | 常规未找到错误 | 
| 1301 | 常规未找到实体 | 
| 1302 | 未找到文件 | 
| 1303 | 未找到提供的函数或函数实现 | 
| 1304 | 查询引擎出现内部错误 | 
| 1305 | 查询引擎出现内部错误 | 
| 1306 | 未找到 Amazon S3 存储桶 | 
| 1307 | 未找到选定的引擎 | 
| 1308 | 查询引擎出现内部错误 | 
| 1400 | 节流错误 | 
| 1401 | 由于 AWS Glue 节流，查询失败 | 
| 1402 | 由于 AWS Glue 中的表版本太多，查询失败 | 
| 1403 | 由于 Amazon S3 节流，查询失败 | 
| 1404 | 由于 Amazon Athena 节流，查询失败 | 
| 1405 | 由于 Amazon Athena 节流，查询失败 | 
| 1406 | 由于 Amazon Athena 节流，查询失败 | 
| 1500 | 权限错误 | 
| 1501 | Amazon S3 权限错误 | 
| 1602 |  已超过预留容量限制。容量不足，无法执行此查询。  | 
| 1700 | 由于 Lake Formation 内部异常，查询失败 | 
| 1701 | 由于 AWS Glue 内部异常，查询失败 | 
| 9999 | 内部服务错误 | 