Expand description
Streaming DDL (CREATE SOURCE/SINK) translator SQL DDL to Streaming API translation.
This module translates parsed SQL CREATE SOURCE/SINK statements into typed streaming definitions that can be used to configure the runtime.
§Supported Syntax
-- In-memory streaming source
CREATE SOURCE trades (
symbol VARCHAR NOT NULL,
price DOUBLE NOT NULL,
quantity BIGINT NOT NULL,
ts TIMESTAMP NOT NULL,
WATERMARK FOR ts AS ts - INTERVAL '100' MILLISECONDS
) WITH (
buffer_size = 131072,
backpressure = 'block'
);
-- In-memory streaming sink
CREATE SINK trade_aggregates AS
SELECT * FROM trade_stats
WITH (
buffer_size = 65536
);§Validation
- Rejects
channel = ...option (channel type is auto-derived) - Validates buffer_size is within bounds
- Validates backpressure strategy names
- Validates wait_strategy names
Structs§
- Column
Definition - Column definition for a streaming source.
- Sink
Definition - A validated streaming sink definition.
- Source
Config Options - Configuration options for a streaming source.
- Source
Definition - A validated streaming source definition.
- Watermark
Spec - Watermark specification for a source.
Enums§
- Backpressure
Strategy - Backpressure strategy for streaming channels.
- Wait
Strategy - Wait strategy for streaming consumers.
Constants§
- DEFAULT_
BUFFER_ SIZE - Default buffer size for streaming channels.
- MAX_
BUFFER_ SIZE - Maximum buffer size for streaming channels.
- MIN_
BUFFER_ SIZE - Minimum buffer size for streaming channels.
Functions§
- sql_
type_ to_ arrow - Converts SQL data type to Arrow data type.
- translate_
create_ sink - Translates a CREATE SINK statement to a typed SinkDefinition.
- translate_
create_ source - Translates a CREATE SOURCE statement to a typed SourceDefinition.