Skip to main content
Creates a stream object that binds to an external change or message feed and defines the schema of its rows. The source kind is determined by the location the stream references:
  • Kafka: the stream binds to a topic and tracks consumer offsets per partition.
  • Postgres: the stream binds to a table and owns a logical replication slot on the source. See the Postgres CDC guide.
  • MongoDB: the stream binds to a collection and tracks a change-stream position. See the MongoDB CDC guide.
Any stream can be read with READ_STREAM. Postgres and MongoDB streams are usually consumed by a CDC table, which applies the changes continuously. Stream metadata is visible in information_schema.streams.

Kafka streams

Kafka stream types

For RAW_TEXT and BINARY stream types, define a single column named data with the matching type.

Postgres streams

Private Preview FeatureThis feature is currently in private preview. Contact support@firebolt.io to request early access.
CREATE STREAM connects to the source and creates the stream’s logical replication slot. It rejects a publication that does not publish insert, update, delete and truncate or filters the table’s rows, and a partitioned table or a table other tables inherit from; see Partitioned source tables.

MongoDB streams

Private Preview FeatureThis feature is currently in private preview. Contact support@firebolt.io to request early access.
A MongoDB stream takes no column list. Its columns are always _id TEXT NOT NULL, the document’s _id rendered as Extended JSON, and doc JSON, the whole document after the change (NULL for a delete). See Read raw change events. CREATE STREAM connects to the deployment, checks the source prerequisites, and records the current end of the collection’s change stream as the stream’s starting position. It fails if the deployment cannot be reached or a prerequisite is not met.

ALTER STREAM

ALTER STREAM applies to Kafka streams only. For Postgres and MongoDB streams, schema changes are drop-and-recreate. Reposition a Kafka stream’s consumer offset on a partition:
Add a column to a Kafka stream’s schema:

DROP STREAM

Removes the stream definition and its tracked position. Data already ingested into Firebolt tables is not affected. Source-side effects:
  • Kafka: none; the topic is untouched.
  • Postgres: the stream’s replication slot (or slots, for a partitioned source) is dropped on the source, so it stops retaining WAL. If the source is unreachable, the stream is still dropped and the error message names the leftover slot for manual removal.
  • MongoDB: none; change streams hold no server-side resource.
Drop or suspend any CDC table consuming the stream first; without its stream, the table’s ingest worker cannot make progress and reports errors in information_schema.cdc_ingests.