从 Amazon S3 批量加载¶
If you already have an Amazon Web Services (AWS) account and use S3 buckets for storing and managing your data files, you can make use of your existing buckets and folder paths for bulk loading into Snowflake. This set of topics describes how to use the COPY command to bulk load from an S3 bucket into tables.
如下图所示,要从 S3 桶中加载数据,分两步执行:
- Step 1:
Snowflake 假定数据文件已暂存在 S3 桶中。如果尚未暂存,请使用 AWS 提供的上传界面/实用程序来暂存文件。
- Step 2:
Use the COPY INTO <table> command to load the contents of the staged file(s) into a Snowflake database table. You can load directly from the bucket, but Snowflake recommends creating an external stage that references the bucket and using the external stage instead.
无论您使用哪种方法,如果您手动或在脚本中执行命令,此步骤都需要运行一个当前虚拟仓库的会话。仓库提供计算资源,以执行将行实际插入到表中的操作。

Note
Snowflake 在其每个 Amazon Virtual Private Cloud 中使用 Amazon S3 网关端点。
只要您的 Snowflake 账户托管在 AWS 上,您的网络流量就不会穿过公共互联网。无论您的 S3 桶位于哪个区域,都是如此。
Tip
The instructions in this set of topics assume you have read Preparing to load data and have created a named file format, if desired.
Before you begin, you may also want to read Data loading considerations for best practices, tips, and other guidance.
后续主题:
-
配置任务(根据需要完成):
-
数据加载任务(针对您加载的每组文件完成):