

# 在 Athena for Spark 中使用非 Hive 表格式
<a name="notebooks-spark-table-formats"></a>

**注意**  
本页指的是在 Pyspark 引擎 3 发行版中使用 Python 库。有关支持的开放表格式版本，请参阅 [Amazon EMR 7.12](https://docs.amazonaws.cn/emr/latest/ReleaseGuide/emr-7120-release.html)。

在 Athena for Spark 中使用会话和笔记本时，除了 Apache Hive 表之外，还可以使用 Linux Foundation Delta Lake、Apache Hudi 和 Apache Iceberg 表。

## 注意事项和限制
<a name="notebooks-spark-table-formats-considerations-and-limitations"></a>

在 Athena for Spark 中使用除 Apache Hive 以外的表格式时，请考虑以下几点：
+ 除了 Apache Hive 之外，每个笔记本仅支持一种表格式。要在 Athena for Spark 中使用多种表格式，为每种表格式创建一个单独的笔记本。有关在 Athena for Spark 中创建笔记本的信息，请参阅 [步骤 7：创建自己的笔记本](notebooks-spark-getting-started.md#notebooks-spark-getting-started-creating-your-own-notebook)。
+ Delta Lake、Hudi 和 Iceberg 表格式已在 Athena for Spark 上使用 Amazon Glue 作为元存储进行了测试。也可以使用其他元存储，但目前不支持这种用法。
+ 要使用其他表格式，按照 Athena 控制台和本文档中的说明覆盖默认 `spark_catalog` 属性。这些非 Hive 目录除了可以读取其自己的表格式，还可以读取 Hive 表。

## 表格版本
<a name="notebooks-spark-table-formats-versions"></a>

下表显示了 Amazon Athena for Apache Spark 中支持的非 Hive 表版本。


****  

| 表格式 | 支持的版本 | 
| --- | --- | 
| Apache Iceberg | 1.2.1 | 
| Apache Hudi | 0.13 | 
| Linux Foundation Delta Lake | 2.0.2 | 

在 Athena for Spark 中，这些表格式 `.jar` 文件及其依赖项将加载到 Spark 驱动程序和执行程序的类路径中。

有关展示如何在 Amazon Athena 笔记本中使用 Spark SQL 处理 Iceberg、Hudi 和 Delta Lake 表格式 *Amazon 大数据博客*文章，请参阅 [Use Amazon Athena with Spark SQL for your open-source transactional table formats](https://www.amazonaws.cn/blogs/big-data/use-amazon-athena-with-spark-sql-for-your-open-source-transactional-table-formats/)。

**Topics**
+ [注意事项和限制](#notebooks-spark-table-formats-considerations-and-limitations)
+ [表格版本](#notebooks-spark-table-formats-versions)
+ [Iceberg](notebooks-spark-table-formats-apache-iceberg.md)
+ [Hudi](notebooks-spark-table-formats-apache-hudi.md)
+ [Delta Lake](notebooks-spark-table-formats-linux-foundation-delta-lake.md)