Skip to main content

Module streaming_ddl

Module streaming_ddl 

Source
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§

ColumnDefinition
Column definition for a streaming source.
SinkDefinition
A validated streaming sink definition.
SourceConfigOptions
Configuration options for a streaming source.
SourceDefinition
A validated streaming source definition.
WatermarkSpec
Watermark specification for a source.

Enums§

BackpressureStrategy
Backpressure strategy for streaming channels.
WaitStrategy
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.