

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 Apache Iceberg 資料表做為目的地的先決條件
<a name="apache-iceberg-prereq"></a>

從下列選項中選擇，以完成必要的先決條件。

**Topics**
+ [在 Amazon S3 中交付至 Iceberg 資料表的先決條件](#iceberg-tables-prerequisites)
+ [交付至 Amazon S3 資料表的先決條件](#s3-tables-prerequisites)

## 在 Amazon S3 中交付至 Iceberg 資料表的先決條件
<a name="iceberg-tables-prerequisites"></a>

開始之前，請先完成下列先決條件。
+ **建立 Amazon S3 儲存貯**體 – 您必須建立 Amazon S3 儲存貯體，以在建立資料表期間新增中繼資料檔案路徑。如需詳細資訊，請參閱[建立 S3 儲存貯體](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html)。
+ **建立具有必要許可的 IAM 角色** – Firehose 需要具有特定許可的 IAM 角色，才能存取 AWS Glue 資料表並將資料寫入 Amazon S3。相同角色用於授予 Amazon S3 儲存貯體的 AWS Glue 存取權。建立 Iceberg 資料表和 Firehose 串流時，您需要此 IAM 角色。如需詳細資訊，請參閱[授予 Firehose 對 Amazon S3 資料表的存取權](controlling-access.md#using-s3-tables)。
+ **建立 Apache Iceberg 資料表** – 如果您要在 Firehose 串流中設定唯一金鑰以進行更新和刪除，Firehose 會驗證資料表和唯一金鑰是否存在做為串流建立的一部分。在此案例中，您必須先建立資料表，才能建立 Firehose 串流。您可以使用 AWS Glue 建立 Apache Iceberg 資料表。如需詳細資訊，請參閱[建立 Apache Iceberg 資料表](https://docs.aws.amazon.com/glue/latest/dg/populate-otf.html#creating-iceberg-tables)。如果您未在 Firehose 串流中設定唯一金鑰，則不需要在建立 Firehose 串流之前建立 Iceberg 資料表。
**注意**  
Firehose 支援 Apache Iceberg 資料表的下列資料表版本和格式。  
**資料表格式版本** – Firehose 僅支援 [V2 資料表格式](https://iceberg.apache.org/spec/#version-2)。請勿以 V1 格式建立資料表，否則您會收到錯誤，而資料會改為傳送到 S3 錯誤儲存貯體。
**資料儲存格式** – Firehose 以 Parquet 格式將資料寫入 Apache Iceberg 資料表。
**資料列層級操作** – Firehose 支援將Merge-on-Read (MOR) 模式。

## 交付至 Amazon S3 資料表的先決條件
<a name="s3-tables-prerequisites"></a>

若要將資料交付至 Amazon S3 資料表儲存貯體，請完成下列先決條件。
+ 建立 S3 Table 儲存貯體、命名空間、資料表儲存貯體中的資料表，以及 [Amazon S3 Tables 入門](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-getting-started.html)中概述的其他整合步驟。資料欄名稱必須小寫，因為 S3 Tables 目錄整合所施加的限制，如 [S3 Tables 目錄整合限制](https://docs.aws.amazon.com/lake-formation/latest/dg/notes-s3-catalog.html)中所指定。
+ **建立具有必要許可的 IAM 角色** – Firehose 需要具有特定許可的 IAM 角色，才能存取 AWS AWS Glue 資料表並將資料寫入 Amazon S3 資料表儲存貯體中的資料表。若要寫入 Amazon S3 資料表儲存貯體中的資料表，您還必須提供 IAM 角色所需的許可。Amazon S3 Tables 目錄所需的許可取決於您使用的存取控制模式：
  + **IAM 存取控制** – Firehose 交付角色需要直接在 Amazon S3 Tables 資源上的 IAM 許可。
  + **Lake Formation 存取控制** – Firehose 交付角色需要 AWS AWS Lake Formation 許可才能管理對資料表資源的存取。 AWS Lake Formation 會使用自己的許可模型，為 Data Catalog 資源啟用精細存取控制。

  您可以在建立 Firehose 串流時設定此 IAM 角色。如需詳細資訊，請參閱[授予 Firehose 對 Amazon S3 Tables 的存取權](https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-s3-tables)。

如需step-by-step整合，請參閱部落格[建置資料湖以使用 Amazon S3 Tables 和 Amazon Data Firehose 串流資料](https://aws.amazon.com/blogs/storage/build-a-data-lake-for-streaming-data-with-amazon-s3-tables-and-amazon-data-firehose/)。如需詳細資訊，請參閱[搭配使用 Amazon S3 Tables 與 AWS 分析服務](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html)。