Skip to main content
Creates a stream object that binds to a Kafka topic and defines the schema for incoming messages. Once created, a stream can be read using READ_STREAM to consume data from Kafka into Firebolt. A stream tracks consumer offsets per partition so that each call to READ_STREAM with consume => true returns only new messages since the last read. You can inspect offsets through information_schema.streams and reposition them with ALTER STREAM.

Syntax

Parameters

Stream types

For RAW_TEXT and BINARY stream types, the stream schema should define a single column named data with the appropriate type (TEXT or BYTEA).

Examples

Create a JSON stream

Create a CSV stream

Create a raw text stream

You can then parse the raw messages in SQL when reading:

Create a stream with a description

ALTER STREAM

You can modify a stream after creation using ALTER STREAM.

Set partition offset

Reposition a stream’s consumer offset on a specific Kafka partition:
Example:

Add column

Add a new column to the stream schema:
Example:

DROP STREAM

Remove a stream object:
Dropping a stream removes the stream definition and its consumer offset tracking. It does not affect data already ingested into Firebolt tables or the underlying Kafka topic.