> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-vortex-format.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 创建你的第一个 Google Cloud Storage ClickPipe 的分步指南。

# 创建你的第一个 GCS ClickPipe

GCS ClickPipe 提供了一种完全托管且具备高弹性的方式，用于从 Google Cloud Storage (GCS) 摄取数据。它同时支持 **一次性** 和 **持续摄取**，并具备精确一次语义。

<Steps>
  <Step title="选择数据源" id="1-select-the-data-source">
    **1.** 在 ClickHouse Cloud 中，先在主导航菜单中选择 **数据源**，再点击 **Create ClickPipe**。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_step0.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=275437c400afd56e6808a20a266c9d7a" alt="选择导入" width="2606" height="790" data-path="images/integrations/data-ingestion/clickpipes/cp_step0.webp" />
    </Frame>

    **2.** 点击 **Google Cloud Storage** 卡片。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/mRaTj__cZTg8Xed9/images/integrations/data-ingestion/clickpipes/object-storage/google-cloud-storage/cp_step1.webp?fit=max&auto=format&n=mRaTj__cZTg8Xed9&q=85&s=24a9ff1845e8cb9b7df9e596325ecd34" alt="选择导入" width="3016" height="952" data-path="images/integrations/data-ingestion/clickpipes/object-storage/google-cloud-storage/cp_step1.webp" />
    </Frame>
  </Step>

  <Step title="设置 ClickPipe 连接" id="2-setup-your-clickpipe-connection">
    **1.** 要设置新的 ClickPipe，您需要提供连接到对象存储服务并完成身份验证所需的详细信息。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/mRaTj__cZTg8Xed9/images/integrations/data-ingestion/clickpipes/object-storage/google-cloud-storage/cp_step2.webp?fit=max&auto=format&n=mRaTj__cZTg8Xed9&q=85&s=f24aaf722b396ce9ed0c46a54411b70e" alt="填写连接信息" width="3014" height="1428" data-path="images/integrations/data-ingestion/clickpipes/object-storage/google-cloud-storage/cp_step2.webp" />
    </Frame>

    * **GCS 文件路径**：GCS ClickPipe 使用 Cloud Storage 的 [XML API](https://docs.cloud.google.com/storage/docs/interoperability) 以实现互操作，因此需要使用 `storage.googleapis.com` 端点：

      ```bash theme={null}
      https://storage.googleapis.com/bucket-name/key-name
      ```

      您可以使用 POSIX 通配符来匹配多个文件或前缀。有关支持的模式，请参阅[参考文档](/zh/integrations/clickpipes/object-storage/google-cloud-storage/overview#file-pattern-matching)。

    **2.** 点击 **Incoming data**。ClickPipes 将从您的存储桶拉取元数据，以便进行下一步。
  </Step>

  <Step title="选择数据格式" id="3-select-data-format">
    界面将显示指定 bucket 中的文件列表。
    选择数据格式 (目前支持部分 ClickHouse 格式) ，并决定是否启用持续摄取。
    更多详细信息，请参阅概览页面中的“持续摄取”部分。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_step3_object_storage.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=1b5bb0f4c602b9662608631fc23ae448" alt="设置数据格式和 topic" width="2336" height="1566" data-path="images/integrations/data-ingestion/clickpipes/cp_step3_object_storage.webp" />
    </Frame>
  </Step>

  <Step title="配置表、schema 和设置" id="5-configure-table-schema-settings">
    在下一步中，您可以选择将数据摄取到新的 ClickHouse 表中，或复用现有表。
    按照界面上的说明修改表名、schema 和设置。
    您可以在顶部的样本表中实时预览这些更改。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_step4a.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=2e7deef33ae050e3a21591d7913ba8c8" alt="设置表、schema 和设置" width="2734" height="1328" data-path="images/integrations/data-ingestion/clickpipes/cp_step4a.webp" />
    </Frame>

    您还可以使用提供的控件自定义高级设置。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_step4a3.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=31f492f080e8703a703670a32ce9cbc4" alt="设置高级控件" width="1592" height="338" data-path="images/integrations/data-ingestion/clickpipes/cp_step4a3.webp" />
    </Frame>

    或者，您也可以选择将数据摄取到现有的 ClickHouse 表中。
    在这种情况下，界面会允许您将源字段映射到所选目标表中的 ClickHouse 字段。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_step4b.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=0f6f8320e5ce05e590810e637300f751" alt="使用现有表" width="2738" height="1322" data-path="images/integrations/data-ingestion/clickpipes/cp_step4b.webp" />
    </Frame>

    <Info>
      您还可以将[虚拟列](/zh/reference/functions/table-functions/s3#virtual-columns) (如 `_path` 或 `_size`) 映射到字段。
    </Info>
  </Step>

  <Step title="配置权限" id="6-configure-permissions">
    最后，您可以为内部 ClickPipes 用户配置权限。

    **权限：** ClickPipes 会创建一个专用用户，用于将数据写入目标表。您可以为该内部用户选择角色，可使用自定义角色或预定义角色之一：

    * `Full access`：拥有整个 cluster 的完全访问权限。如果目标表使用了 materialized view 或 字典，则需要选择此项。
    * `Only destination table`：仅拥有目标表的 `INSERT` 权限。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_step5.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=ac9fe916e6c9fe09445c8b9fe0f3934f" alt="权限" width="2736" height="1318" data-path="images/integrations/data-ingestion/clickpipes/cp_step5.webp" />
    </Frame>
  </Step>

  <Step title="完成设置" id="7-complete-setup">
    点击“Complete Setup”后，系统将注册您的 ClickPipe，随后您可以在摘要表中看到它。

    <div className="ch-image-sm">
      <Frame>
        <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_success.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=3c1eea1c5a2b2c3ebf383e18671e9968" alt="成功提示" width="613" height="212" data-path="images/integrations/data-ingestion/clickpipes/cp_success.webp" />
      </Frame>
    </div>

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_remove.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=8fe01d6260e42e4a9dde9a1e040e93e2" alt="删除提示" width="2756" height="1320" data-path="images/integrations/data-ingestion/clickpipes/cp_remove.webp" />
    </Frame>

    摘要表提供了相关控件，可用于显示源中的样本数据，或显示 ClickHouse 中目标表的数据。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_destination.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=3d56c9f3457a8c0e0c37731d3b24e36f" alt="查看目标端" width="2758" height="1316" data-path="images/integrations/data-ingestion/clickpipes/cp_destination.webp" />
    </Frame>

    以及用于删除 ClickPipe 并显示摄取作业摘要的控件。

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-vortex-format/Kj4wT80mHNH7Aczn/images/integrations/data-ingestion/clickpipes/cp_overview.webp?fit=max&auto=format&n=Kj4wT80mHNH7Aczn&q=85&s=556f0e192c4b566d50be4a76ae831a05" alt="查看概览" width="3436" height="1076" data-path="images/integrations/data-ingestion/clickpipes/cp_overview.webp" />
    </Frame>

    **恭喜！** 您已成功设置第一个 ClickPipe。
    如果这是一个配置为持续摄取的 ClickPipe，它将持续运行，并从远程数据源实时摄取数据。
    否则，它会摄取该批次数据后完成。
  </Step>
</Steps>
