

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

# 在 EMR Studio 中使用 Amazon Athena SQL 編輯器
<a name="emr-studio-athena"></a>

## 概觀
<a name="emr-studio-athena-overview"></a>

您可以使用 Amazon EMR Studio 在 Amazon Athena 上開發和執行互動式查詢。這意味著您可以從用於執行 Spark、Scala 和其他工作負載的同一個 EMR Studio 介面，在 Athena 上執行 SQL 分析。透過此整合，您可以使用自動完成快速開發查詢、瀏覽 Glue Data Catalog AWS 中的資料、建立已儲存的查詢、檢視查詢歷史記錄等。

如需有關使用 Amazon Athena 的詳細資訊，請參閱《Amazon Athena 使用者指南》**中的[使用 Athena SQL](https://docs.aws.amazon.com/athena/latest/ug/using-athena-sql.html)。

## 在 EMR Studio 中使用 Athena SQL 編輯器
<a name="emr-studio-athena-use"></a>

使用下列步驟，從您的 EMR Studio 在 Amazon Athena 上開發和執行互動式查詢：

1. 針對存取此 Studio 中工作區的使用者，將必要的許可新增至使用者角色。這些許可列在 [AWS Identity and Access Management EMR Studio 使用者的 許可](emr-studio-user-permissions.md#emr-studio-iam-permissions-table) 表格的**從 EMR Studio 存取 Amazon Athena SQL 編輯器**資料欄中。或者，您可以選擇從 [範例使用者政策](emr-studio-user-permissions.md#emr-studio-example-policies) 複製**進階**政策內容，以授予使用者對 EMR Studio 功能 (包括此功能) 的完整許可。

1. [設定](emr-studio-set-up.md)並[建立 EMR Studio](emr-studio-create-studio.md)。

1. 導覽至您的 Studio，然後從側邊欄中選擇**查詢編輯器**。

現在您應該看到熟悉的 Athena 編輯器使用者介面。如需有關入門和使用 Athena SQL 執行互動式查詢的資訊，請參閱《Amazon Athena 使用者指南》**中的[入門](https://docs.aws.amazon.com/athena/latest/ug/getting-started.html)和[使用 Athena SQL](https://docs.aws.amazon.com/athena/latest/ug/using-athena-sql.html)。

**注意**  
如果您已透過 IAM Identity Center 為 EMR Studio 啟用 Trusted Identity Propagation，則必須使用 Athena 工作群組來控制查詢存取，而且您使用的工作群組也必須使用 Trusted Identity Propagation 功能。如需了解為工作群組設定 Identity Center 和啟用 Trusted Identity Propagation 的步驟，請參閱《Amazon Athena 使用者指南》**中的[使用啟用 IAM Identity Center 的 Athena 工作群組](https://docs.aws.amazon.com/athena/latest/ug/workgroups-identity-center.html)。

## 在 EMR Studio 中使用 Athena SQL 編輯器的考量事項
<a name="emr-studio-athena-considerations"></a>
+ 與 Athena 的整合適用於所有提供 EMR Studio 和 Athena 的商業區域。
+ 下列 Athena 功能不適用於 EMR Studio：
  + 建立或更新 Athena 工作群組、資料來源或容量保留等管理員功能
  + Athena for Spark 或 Spark 筆記本
  + Amazon DataZone 整合
  + 成本型最佳化工具 (CBO)
  + Step Functions