public interface SnowflakeStreamingIngestChannel
Channels are identified by their name and only one channel with the same name may ingest data at the same time. When a new channel is opened, all previously opened channels with the same name are invalidated (this applies for the table globally. not just in a single JVM). In order to ingest data from multiple threads/clients/applications, we recommend opening multiple channels, each with a different name. There is no limit on the number of channels that can be opened.
Thread safety note: Implementations of this interface are required to be thread safe.
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
close()
Close the channel, this function will make sure all the data in this channel is committed
|
String |
getDBName()
Get the database name
|
String |
getFullyQualifiedName()
Get the fully qualified channel name
|
String |
getFullyQualifiedTableName()
Get the fully qualified table name that the channel belongs to
|
String |
getLatestCommittedOffsetToken()
Get the latest committed offset token from Snowflake
|
String |
getName()
Get the name of the channel
|
String |
getSchemaName()
Get the schema name
|
String |
getTableName()
Get the table name
|
InsertValidationResponse |
insertRow(Map<String,Object> row,
String offsetToken)
Insert one row into the channel, the row is represented using Map where the key is column name
and the value is a row of data.
|
InsertValidationResponse |
insertRows(Iterable<Map<String,Object>> rows,
String offsetToken)
Insert a batch of rows into the channel, each row is represented using Map where the key is
column name and the value is a row of data.
|
boolean |
isClosed() |
boolean |
isValid() |
String getFullyQualifiedName()
String getName()
String getDBName()
String getSchemaName()
String getTableName()
String getFullyQualifiedTableName()
boolean isValid()
boolean isClosed()
CompletableFuture<Void> close()
InsertValidationResponse insertRow(Map<String,Object> row, @Nullable String offsetToken)
| Snowflake Column Type | Allowed Java Data Type |
|---|---|
| CHAR, VARCHAR |
|
| BINARY |
|
| NUMBER, FLOAT |
|
| BOOLEAN |
|
| TIME |
|
| DATE |
|
| TIMESTAMP_NTZ, TIMESTAMP_LTZ, TIMESTAMP_TZ |
OpenChannelRequest.OpenChannelRequestBuilder.setDefaultTimezone(ZoneId).
|
| VARIANT, ARRAY |
|
| OBJECT |
|
| GEOGRAPHY, GEOMETRY | Not supported |
row - object data to write. For predictable results, we recommend not to concurrently
modify the input row data.offsetToken - offset of given row, used for replay in case of failures. It could be null
if you don't plan on replaying or can't replayInsertValidationResponse insertRows(Iterable<Map<String,Object>> rows, @Nullable String offsetToken)
insertRow(Map, String) for more information about accepted
values.rows - object data to writeoffsetToken - offset of last row in the row-set, used for replay in case of failures, It
could be null if you don't plan on replaying or can't replayString getLatestCommittedOffsetToken()
Copyright © 2023. All rights reserved.