Class AppendOnlyKeyValueTable
- java.lang.Object
-
- com.snowflake.connectors.common.table.AppendOnlyKeyValueTable
-
- All Implemented Interfaces:
AppendOnlyTable
public class AppendOnlyKeyValueTable extends Object implements AppendOnlyTable
Default implementation ofAppendOnlyTable, which stores the data as key-value pairs, similarly to the default implementation ofKeyValueTable.This implementation requires that the backing Snowflake table has the following structure:
- column
keyof typeSTRING - column
valueof typeVariant - column
updated_atof typeTIMESTAMP_NTZ
-
-
Constructor Summary
Constructors Constructor Description AppendOnlyKeyValueTable(Session session, String tableName)Creates a newAppendOnlyKeyValueTable, backed by the provided Snowflake table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Variantfetch(String key)Fetches the most recent value stored under the provided key.List<Variant>getAllWhere(Column filter)Returns all values from this table where the record matches the provided filter.voidinsert(String key, Variant value)Inserts the provided value under the provided key into this table.
-
-
-
Constructor Detail
-
AppendOnlyKeyValueTable
public AppendOnlyKeyValueTable(Session session, String tableName)
Creates a newAppendOnlyKeyValueTable, backed by the provided Snowflake table.- Parameters:
session- Snowpark session objecttableName- name of the Snowflake table
-
-
Method Detail
-
fetch
public Variant fetch(String key)
Description copied from interface:AppendOnlyTableFetches the most recent value stored under the provided key.- Specified by:
fetchin interfaceAppendOnlyTable- Parameters:
key- key associated with the value- Returns:
- most recent value stored under the provided key
-
insert
public void insert(String key, Variant value)
Description copied from interface:AppendOnlyTableInserts the provided value under the provided key into this table.- Specified by:
insertin interfaceAppendOnlyTable- Parameters:
key- key associated with the valuevalue- value
-
getAllWhere
public List<Variant> getAllWhere(Column filter)
Description copied from interface:AppendOnlyTableReturns all values from this table where the record matches the provided filter.- Specified by:
getAllWherein interfaceAppendOnlyTable- Parameters:
filter- filter for the table records- Returns:
- values from records which match the provided filter
-
-