readSnapshots Function
This function reads snapshot data from either Parquet or CSV files for a specified stream.
Parameters:
stream(string): The name of the stream to read snapshots for.snapshotDir(string): The directory containing the snapshot files.options(object): Optional. CSV read options.
- A
Polars.DataFramecontaining the snapshot data, ornullif no snapshot exists.
snapshotRecords Function
This function creates or updates snapshot records for a data stream with options for deduplication, type coercion, and more.
Parameters:
streamData(Polars.DataFrame or null): The data to snapshot.stream(string): The name of the stream.snapshotDir(string): The directory to store snapshot files.pk(string): Primary key for deduplication. Defaults to “id”.justNew(boolean): Whether to return only new data instead of the full snapshot.useCsv(boolean): Whether to write snapshots as CSV instead of Parquet.coerceTypes(boolean): If true, types are coerced to matchstreamDatadtypes.localizeDatetimeTypes(boolean): If true, converts datetime columns to UTC.overwrite(boolean): If true, overwrites the snapshot entirely instead of merging.options(object): Additional options for CSV reading.
- The updated
Polars.DataFrameof the snapshot, merged according to the primary key specified.