Streams, windows, and delta streams offer different characteristics and features, but also share common designation, visibility, and column parameters.
The terms stateless and stateful commonly describe the most significant difference between windows and streams. A stateful element has the capacity to store information, while a stateless element does not.
Streams, windows, and delta streams share several important characteristics, including implicit columns and visibility rules.
Feature Capability | Streams | Windows | Delta Streams |
---|---|---|---|
Type of element | Stateless | Stateful, due to retention and store capabilities | Stateless |
Data retention | None | Yes, rows (based on retention policy) | None |
Available store types | Not applicable | Memory store or log store | Not applicable |
Element types that can be derived from this element | Stream or a Window with an aggregation clause (GROUP BY) | Stream, Window, Delta Stream | Stream, Window, Delta Stream |
Primary key Required | No | Yes, explicit or deduced | Yes, explicit or deduced |
Support for aggregation operations | No | Yes | No |
Behavior on receiving insert/update/delete | Produces insert. Converts update to insert. Ignores delete. | Produces insert, update, or delete according to the exceptions listed below. Generates an error on duplicate inserts, bad updates, and bad deletes. Windows with a retention policy treat update as upsert. | Produces insert, update, or delete according to the exceptions listed below. Does not detect duplicate inserts, bad updates, or bad deletes. Delta streams produced by a Flex Operator do not receive updates. |
Behavior on receiving upsert/safedelete | Converts upsert to insert. Ignores safedelete. | Produces insert, update, or delete according to the exceptions listed below. | Delta streams do not receive upserts or safedeletes. |