> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 如何在 ClickHouse Cloud 中连接您的 Iceberg 目录

> 了解如何将 ClickHouse Cloud 连接到您的数据目录，以查询 Iceberg 表。

export const e_1 = undefined

export const e_0 = undefined

<a href="/docs/get-started/quickstarts/home" onClick={(e_0) => { e_0.preventDefault(); window.location.href = (window.location.pathname.startsWith('/docs') ? '/docs' : '') + '/get-started/quickstarts/home'; }} className="inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-zinc-500 hover:text-gray-900 dark:hover:text-[#fdff75] transition-colors font-normal no-underline"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="shrink-0"><path d="M19 12H5" /><path d="M12 19l-7-7 7-7" /></svg>All quickstarts</a>

<div className="mt-2 flex flex-wrap gap-2">
  <Badge size="lg" color="blue">数据仓储</Badge>
  <Badge size="lg" color="orange">Cloud</Badge>
</div>

<div id="prerequisites">
  ## 前置条件
</div>

在开始本快速入门之前，您需要具备：

To successfully follow this guide, you'll need the following:

* A running ClickHouse Cloud service. If you don't have one yet, complete the [ClickHouse Cloud quick start](/docs/get-started/setup/cloud) first.

- 可访问 **兼容 Iceberg 的数据湖**
- **Data Lake Catalog** (URL 和凭据)
- 根据数据湖目录类型，还需要对象存储凭据 (例如兼容 S3 的存储)
- 在目录中注册的至少一个现有 Iceberg 表

如果您的 Iceberg 目录中还没有数据，可以上传此数据集。我们将在此处使用该数据集进行演示。

<div id="what-youll-build">
  ## 你将构建的内容
</div>

在本快速入门中，你将：

* 在 ClickHouse Cloud 中连接到 Iceberg REST Catalog
* 创建一个由该目录支持的 ClickHouse 数据库
* 直接从 ClickHouse 查询现有的 Iceberg 表
* 验证 ClickHouse 正在从你的数据湖读取数据

完成后，你将把 ClickHouse Cloud 连接到你的 Iceberg 目录，并能够在不复制数据的情况下对 Iceberg 表运行 SQL 查询。

<Steps titleSize="h3">
  <Step title="创建 DataLakeCatalog 连接" id="create-a-datalakecatalog-connection">
    在此步骤中，你将连接到 ClickHouse Cloud 中的 Data Lake Catalog。

    1. 打开你的 ClickHouse Cloud 服务。

    2. 导航到 **Data Sources â Connect to your Data Lake Catalog**。

    3. 在下拉菜单中选择你的数据目录。

    4. 使用你的凭据和连接信息填写表单。
       对于 Unity Catalog，请输入：

       * Open Table Format (Iceberg)
       * ClickHouse Database name。这将是你的 ClickHouse 数据库名称，你将通过该数据库查询 Iceberg 表。
       * Workspace ID
       * Databricks catalog name
       * Client ID
       * Client Secret

       **插入图片**

    5. 保存该目录。现在，你应该会在 Data Sources 页面中看到已加载的数据目录，以及该数据库中可用表的数量。
  </Step>

  <Step title="查询 Iceberg 表" id="query-iceberg-table">
    在此步骤中，你将从 数据目录 查询一个 Iceberg 表。

    1. 点击 `Show Tables` 或 `SQL Console` 后，你将进入 SQL 控制台
       并看到与你的数据湖关联且已 materialized 的新数据库。如果你是通过 `SQL Console` 进入，请将数据库下拉菜单切换为你的 Iceberg 数据库。
    2. 你应该会在文件树中看到一个或多个 Iceberg 表。运行以下查询：

    ```sql theme={null}
    select * from iceberg_database.`iceberg_db.your_table`
    ```

    3. ClickHouse 将返回你的 Iceberg 表中的行。
  </Step>
</Steps>

<div id="next-steps">
  ## 后续步骤
</div>

现在你已连接到数据湖，可以试着在 ClickHouse 中写入 Iceberg 表。

<Tip>
  请注意引号的使用。ClickHouse 不支持三段式命名空间，因此必须给 `schema.table` 加上引号。
</Tip>

<Frame caption="Check out the ClickHouse academy for on-demand and live training">
  <a href="https://learn.clickhouse.com/" target="_blank">
    <img src="https://mintcdn.com/private-7c7dfe99/EDr8ydtGBgFPOQea/images/academy.webp?fit=max&auto=format&n=EDr8ydtGBgFPOQea&q=85&s=27e92fc656183cc2f176211907a7aa49" alt="ClickHouse Academy — Master ClickHouse with expert-designed training for every skill level" width="560" noZoom data-path="images/academy.webp" />
  </a>
</Frame>

<div className="mt-8">
  <a href="/docs/get-started/quickstarts/home" onClick={(e_1) => { e_1.preventDefault(); window.location.href = (window.location.pathname.startsWith('/docs') ? '/docs' : '') + '/get-started/quickstarts/home'; }} className="inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-zinc-500 hover:text-gray-900 dark:hover:text-[#fdff75] transition-colors font-normal no-underline"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="shrink-0"><path d="M19 12H5" /><path d="M12 19l-7-7 7-7" /></svg>All quickstarts</a>
</div>
