Snowpipe Streaming classic architecture¶
重要
Advance notice: Snowpipe Streaming classic architecture is fully supported today, but it is planned for future deprecation.
Action: No immediate changes are required. Your current workloads are safe and continue to be fully supported.
Timeline: Snowflake plans to issue a formal deprecation announcement in mid-2026. This milestone refers to the announcement date only. After the deprecation announcement, an 18-month migration window begins before the end-of-life date.
Recommendation: Use the high-performance architecture for all new implementations.
For full details, FAQs, and migration guidance, see Notice of planned deprecation.
Snowpipe Streaming 经典架构提供了一种成熟且高效的方法,可持续低延迟且以行为基础将数据直接引入到 Snowflake 表中。这种实现方式在文档中称为 Snowpipe Streaming Classic,仍然是各种流式传输工作负载的可靠选择,例如应用程序事件数据、物联网 (IoT) 传感器读数和低延迟变更数据捕获 (CDC)。
Snowpipe Streaming Classic 采用 snowflake-ingest-java SDK,并且不采用 Snowpipe Streaming 高性能架构中用于管理数据流的核心概念:显式 PIPE 对象。相较之下,在 Snowpipe Streaming Classic 中,通道是更直接地针对表进行配置的,提供了一种更常用的成熟方式,将数据流式传输到 Snowflake。
软件要求¶
SDK:使用 snowflake-ingest-sdk (https://mvnrepository.com/artifact/net.snowflake/snowflake-ingest-sdk) 版本 4.X 或更高版本。
Java 版本:需要 Java 8 或更高版本。
其他先决条件:必须为 Java 8 环境安装 Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files。
有关经典架构的类和接口的文档,请参阅 Snowflake Ingest SDK API (https://javadoc.io/doc/net.snowflake/snowflake-ingest-sdk/latest/overview-summary.html)。
有关经典架构和高性能架构之间的区别,请参阅 API 区别。
自定义客户端应用程序¶
The API requires a custom Java application interface that can accept rows of data and handle errors that occur. You must ensure that the application runs continuously and can recover from failure. For a given batch of rows, the API supports the equivalent of ON_ERROR = CONTINUE | SKIP_BATCH | ABORT.
CONTINUE:继续加载可接受的数据行,并返回所有错误。SKIP_BATCH:如果在整批行中遇到任何错误,则跳过加载并返回所有错误。:code:`ABORT`(默认设置):中止整批行,并在遇到第一个错误时抛出异常。
对于 Snowpipe Streaming Classic,应用程序使用 insertRow`(单行)或 :code:`insertRows`(行集)方法的响应进行架构验证。有关高性能架构的错误处理,请参阅 :doc:`错误处理 </user-guide/snowpipe-streaming/snowpipe-streaming-high-performance-error-handling>。
将数据加载到 Apache Iceberg™ 表中¶
借助 Snowflake Ingest SDK 3.0.0 及更高版本,Snowpipe Streaming 可以将数据引入 Snowflake 管理的 Apache Iceberg 表中。Snowpipe Streaming Ingest Java SDK 支持加载到标准 Snowflake 表( 非Iceberg)和 Iceberg 表。
有关更多信息,请参阅 Snowpipe Streaming Classic with Apache Iceberg™ tables。
迁移到经典架构中的优化文件¶
API 将通道中的行写入云存储中的 blob,然后提交到目标表。在初始情况下,写入目标表的流数据以临时中间文件格式存储。在此暂存区,该表被视为“混合表”,因为分区数据使用本机文件与中间文件的混合形式存储。一个自动后台进程根据需要,将数据从活动中间文件迁移到针对查询和 DML 操作而优化的本机文件。
在经典架构中复制¶
Snowpipe Streaming 支持 Snowpipe Streaming 填充的 Snowflake 表及其关联的通道偏移从不同 区域、跨 云平台 的源账户到目标账户的 复制和故障转移。
有关更多信息,请参阅 复制和 Snowpipe 流。