ColumnQuery

Answers a predicate from a shredded column where it can and a scan where it cannot.

The narrow reference implementation, exactly like IndexQuery and kept for the same reason. rabosh-query owns the predicate AST, the planner and execution, and answers anything this does while combining it with other predicates; what this remains is a second, independently written implementation of the same claims — identical results with and without a column, no document opened, bounds prune blocks — over the same reader. Reach for QueryEngine instead.

The recheck, and the one place it is skipped. .claude/rules/index-and-query.md requires every index hit to be re-evaluated against the version the snapshot can see, because a key may live in several segments and the newest wins. That rule is kept. It is skipped only where it is provably a no-op: when the reader is authoritative and the key appears in exactly one usable segment, that segment's version is the visible version, and uniqueness is decided from the key blocks — a sidecar read, not a document read. Everywhere else the document is opened and counted.

That qualification is what makes documentsRead == 0 an honest claim rather than a fudge: it holds on a compacted, write-once, fully covered store, which is the same shape SchemaInferenceTest requires before it asserts the catalog's counts are exact.

Functions

Link copied to clipboard
fun keysMatching(store: DocumentStore, reader: ColumnReader, predicate: ColumnPredicate): ColumnScan

Keys whose visible document satisfies predicate at the reader's path.

Link copied to clipboard
fun scanKeys(store: DocumentStore, reader: ColumnReader, predicate: ColumnPredicate): ColumnScan

Every key a full scan says matches, with no column involved.