snowflake.ingest.streaming.StreamingIngestElasticChannel¶
- logger¶
- class StreamingIngestElasticChannel(channel: snowflake.ingest.streaming._python_ffi.PyChannel, pending_futures: Dict[int, concurrent.futures.Future], *, binary_input_format: snowflake.ingest.streaming._python_ffi.PyBinaryInputFormat, _internal: bool = False)¶
Elastic channel for Snowflake Streaming Ingest.
Unlike regular channels, elastic channels have no offset token concepts and their lifecycle is tied to the client (no close method). The same instance is returned on repeated calls to
get_elastic_channel().Note
This class should not be instantiated directly. Use
get_elastic_channel()to obtain the elastic channel instance.- append_row(row: Dict[str, Any]) concurrent.futures.Future¶
Append a single row into the elastic channel.
- Parameters:
row – Dictionary representing the row data to append.
- Returns:
Completes when the row is acknowledged by Snowflake.
- Return type:
Future
- Raises:
ValueError, TypeError – If the row cannot be serialized to JSON.
StreamingIngestError – If the row appending fails.
- append_rows(rows: List[Dict[str, Any]]) concurrent.futures.Future¶
Append multiple rows into the elastic channel.
- Parameters:
rows – List of dictionaries representing the row data to append.
- Returns:
Completes when the rows are acknowledged by Snowflake.
- Return type:
Future
- Raises:
ValueError, TypeError – If the rows cannot be serialized to JSON.
StreamingIngestError – If the rows appending fails.
- initiate_flush() None¶
Initiate a flush of all buffered data in this channel without waiting for completion.
- Raises:
StreamingIngestError – If initiating the flush fails.
- get_channel_status() ChannelStatus¶
Get the status of the elastic channel.
- Returns:
The status of the channel.
- Return type:
- Raises:
StreamingIngestError – If getting the channel status fails.
- is_closed() bool¶
Check if the elastic channel is closed (because the client was closed).
- Returns:
True if the channel is closed, False otherwise.
- Return type:
bool
- property channel_name: str¶
Get the channel name (always “ELASTIC”).
- property db_name: str¶
Get the database name.
- property schema_name: str¶
Get the schema name.
- property pipe_name: str¶
Get the pipe name.