colstore.Appender¶
- class colstore.Appender(directory, *, name='shard_{index:05d}.cstore', shard_size=None, statistics=False)[source]¶
Bases:
objectStreaming append: roll new shards into a dataset directory from a batch stream.
Construct via
colstore.appender(). Eachwrite()accumulates a batch; a new shard is committed whenever the buffer reachesshard_size(rows, a byte string like"512 MiB", orNoneto roll only on an explicitflush()).close()flushes any remainder and releases the directory lock. Use as a context manager. LikeColStoreWriter, a forgotten close is committed from__del__with aResourceWarning.- write(data)[source]¶
Buffer one batch; commit a shard if
shard_sizeis reached.- Parameters:
data (Any)
- Return type:
None