latestKeyedTable#
- swordfish.function.latestKeyedTable()#
Create a keyed table, which is a special type of in-memory table with primary key. The primary key can be one column or multiple columns. Compared to the keyedTable, latestKeyedTable adds a time column to determine whether to update records.
When a new record is appended to the keyed table, if its timestamp is smaller than that of the existing row which has the same primary key, it does not overwrite the existing row. latestKeyedTable deduplicates records with the same primary key based on the time column, which affects its writing performance (relatively slow compared with keyedTable).
Note
The primary key cannot be modified (with functions update, or replaceColumn_) or deleted (with functions alter, or dropColumns_).