Skip to main content

Module routing

Module routing 

Source
Expand description

Row→vnode routing shared by the cluster shuffle paths (the aggregate row-shuffle, the lookup-enrich key-shuffle, and ClusterRepartitionExec). Hashing matches crate::state::VnodeRegistry::vnode_for_key so every stage agrees on a key’s vnode.

Functions§

row_vnodes
Vnode for each row, hashing columns (by index) with the engine’s arrow-row + xxh3 encoding. columns must be non-empty.
slice_batch_by_targets
Slices a RecordBatch by targets. Remote rows are grouped by NodeId, and the metadata column __laminar_vnode is appended to the batch. Local rows are grouped by vnode.
slice_batch_by_vnode
The sub-batch of batch whose row_vnodes[i] == target, or None if no row maps to target.
slice_batch_by_vnodes
Slice batch by vnodes in a single pass, returning a vector of (vnode, RecordBatch). Avoids the $O(V \times R)$ loop and allocations of vnode-by-vnode slicing.