Skip to main content

topk_result_to_columnar

Function topk_result_to_columnar 

Source
fn topk_result_to_columnar<'s, T>(
    collection: VecCollection<'s, T, (Row, Row), Diff>,
) -> Collection<'s, T, Column<(Row, T, Diff)>>
where T: RenderTimestamp,
Expand description

Drops the hash-key pairing from a consolidated (hash_key, row) TopK result.

The hash key is a function of the row and the input is consolidated, so dropping the key is injective and the output has no within-batch duplicates for a consolidating builder to fold. Rows are pushed borrowed.

TODO: TopK renders its stages over Vec containers, so this encode sits at the very end of the plan. Pushing columnar containers down through build_topk and the monotonic path would remove it, leaving a projection that drops the hash.