colstore.ColStoreInfo

class colstore.ColStoreInfo(path, format_version, n_rows, n_records, columns, file_size)[source]

Bases: object

Summary of a colstore file’s contents and on-disk shape.

Returned by info(). Fields are populated from the file header without scanning any record bodies, so the call is fast even on large files.

Parameters:
path

Filesystem path the info was read from.

Type:

pathlib.Path

format_version

On-disk format version. Currently always 1.

Type:

int

n_rows

Total committed row count across all records.

Type:

int

n_records

Number of records in the file. A one-shot write or a fully compacted file has n_records == 1.

Type:

int

columns

Schema: one {"name": ..., "dtype": ..., "encoding": ..., "nullable": ...} per column, in declaration order.

Type:

list[dict]

file_size

Size of the file in bytes (os.path.getsize).

Type:

int

property needs_compaction: bool

True if collapsing the file to one record would help.

A multi-record file pays a per-pattern dispatch cost on reads (cheap for slice and sorted-fancy, expensive for unsorted-fancy as records accumulate). After compact(), all reads take the single-record fast path.