Part of #276 (Phase 1).
Goal
A pure function in beacon-nd-arrow that classifies, from broadcast geometry alone, how each output column of a flattened ND batch should be encoded.
Signature (sketch)
classify_encoding(variable_dims, broadcast_target_shape, flatten_order) -> Vec<ColumnEncoding>
// ColumnEncoding = Flat | RunEndEncoded | Dictionary
Rules
- Outer / slow-varying broadcast dim →
RunEndEncoded (run length = product of inner dims).
- Inner / fast-varying cyclic broadcast dim →
Dictionary (low cardinality, short cycles in row-major).
- Non-broadcast data column →
Flat.
Notes
- Exact, geometry-derived — no statistical/cardinality detection.
- No DataFusion dependency (keep
beacon-nd-arrow arrow-only).
Acceptance
- Unit tests over known geometries (single/multi broadcast dims, mixed ranks, chunked shapes).
Part of #276 (Phase 1).
Goal
A pure function in
beacon-nd-arrowthat classifies, from broadcast geometry alone, how each output column of a flattened ND batch should be encoded.Signature (sketch)
Rules
RunEndEncoded(run length = product of inner dims).Dictionary(low cardinality, short cycles in row-major).Flat.Notes
beacon-nd-arrowarrow-only).Acceptance