Polars Groups Columns So One Pass Feeds Many Aggregations
Grouping in Polars is a separate stage: keys are encoded (single key, key rows, row encoding, or binview), hashed into group ids by a Grouper, and every aggregation expression then …
Grouping in Polars is a separate stage: keys are encoded (single key, key rows, row encoding, or binview), hashed into group ids by a Grouper, and every aggregation expression then …
Polars lowers the user-facing Expr tree into a flat Arena of nodes addressed by integer Node handles, which the physical planner walks to build Arc operators.
Nulls live in a side-channel validity bitmap, not in the value buffer, which lets DataFusion branch once on ‘has any nulls’ and skip whole loops, filters, and comparisons.
Column bytes live in refcounted buffers; sharing a column clones handles, and the Arrow FFI imports foreign memory by keeping the C array alive as the buffer’s owner.
The View type packs a 4-byte length, 4-byte prefix, buffer index and offset into 16 bytes, and inlines any string of 12 bytes or less directly into those bytes.