colstore.append¶
- colstore.append(directory, data, *, name='shard_{index:05d}.cstore', statistics=False, batch_size='auto', show_progress=False)[source]¶
Append
datato the dataset atdirectoryas one new shard.The directory is created if needed and its
.cstoreshards form the dataset (read withcolstore.open(directory)).datais anythingcolstore.store()accepts – a{name: array}dict, a structured array, or a DataFrame – or an open reader / dataset, or a path to a.cstorefile (or directory of them). It must match the existing shards’ schema. The shard is named fromname(a template whose{index}is the next free shard number, or a literal filename; it must end in.cstore) and committed atomically. Returns the new shard’s path.statistics=Truerecords per-record statistics in the shard (seecolstore.store()).A colstore source (path, reader, or dataset) is written without materializing it into memory: its columns are streamed into the shard in bounded memory, so a file far larger than RAM can be appended.
statistics=Trueuses the materializing path (the streaming writer records no footer).Raises
OSErrorif another writer holds the directory lock, andValueErrorifnamelacks the.cstoreextension,datadoes not match the existing schema, ordatais the dataset’s own directory (a self-append would duplicate every existing row).