Introduction to streams and tasks¶
Snowflake 通过 Streams 和 Tasks 支持连续数据管道:
- 流:
流 对象记录表(例如暂存表)的更改数据获取 (CDC) 信息的增量,包括插入和其他数据操作语言 (DML) 更改。流允许在两个事务时间点之间在行级别查询和使用对表的一组更改。
在连续数据管道中,表流会记录何时使用连续数据加载将来自业务应用程序的数据填充到暂存表和任何下游表中,以及何时可使用 SQL 语句进行进一步处理。
有关更多信息,请参阅 Introduction to streams。
- 任务:
A task object runs a SQL statement, which can include calls to stored procedures. Tasks can run on a schedule or based on a trigger that you define, such as the arrival of data. You can use task graphs to chain tasks together, defining directed acyclic graphs (DAGs) to support more complex periodic processing. For more information, see 任务简介 and 使用任务图创建任务序列.
将任务与表流相结合是持续处理新数据或更改的数据的一种方便而强大的方法。使用 SYSTEM$STREAM_HAS_DATA,任务可以转换流显示的新行或更改的行。每次任务运行时,都可以使用更改的数据,如果不存在更改的数据,则可以跳过当前运行。
有关其他连续数据管道功能,请参阅:
Continuous data loading with Snowpipe, Snowpipe Streaming, or Snowflake Connector for Kafka.
使用 动态表 进行连续数据转换。