pub fn native_tree_supported(tree: &NativeTree) -> boolExpand description
Whether the native runtime executes tree, answered from the tree itself.
This is the question the native route asks before it commits a statement: a tree the runtime
refuses has to keep the plan it had, because a refusal raised during physical planning cannot
fall back. It used to be answered by building a
NativeExecutionState over the tree and
dropping it, which allocates a runtime node per node per partition only to throw it away. Every
term of the answer is bound on the tree, so the answer is read from the tree instead.
§What is refused
This lists what RuntimeNode::build (and the root check in
NativeExecutionState::try_new) refuses, less what NativeNode::validate has already
refused: a NativeTree exists only through NativeTree::try_new or Deserialize, and both
validate, so a compiled tree’s per-node type contracts hold by the time this runs. What is left
is the shape of the nodes, and the arithmetic each of them leaves to the runtime:
- a root that answers raw samples, which has no positions to answer on;
- an input leaf whose series chunks may interleave, which no consumer of a leaf can order;
scalar()over a vector carrying more than one field;- a binary node that is neither a vector–vector operation nor a broadcast the runtime performs:
two constant operands (no series to carry the result), a scalar broadcast carrying
vector-matching modifiers, or
boolon an arithmetic operator, which has noboolform; - a
quantileaggregate at any stage butComplete, which would need a partial state it does not keep (validaterefuses one for the same reason; this arm keeps the predicate and the runtime agreeing on it); - an aggregate below
Finalwhosebynames a value field, which would fold series the existing plan keeps apart; topk,bottomk,limitk,sortandsort_descover a vector carrying more than one field, whose series have no one value to rank;- a
topk,bottomk,limitkorcount_valuesgrouping that names a value field, and acount_valueslabel that is empty; - a window whose
anchoredorsmoothedmodifier reads evaluated input, names a function its kernel does not correct, or carries a negative lookback; - a window whose timestamps do not fit: the fold offset an
@anchor turns into, or the onepredict_linearadds to a point of the grid, where the sum leavesi64. Not a shape, but it is decided by the grid and the window alone, so this is where it is decided (seewindow_instants_fit).
§What NativeExecutionState::try_new still decides
Not every refusal is decided by the tree, and the ones below stay where the runtime builds:
- a reservation the memory pool refuses, which no tree carries. Every site that admits a tree
ran the trial build over an
UnboundedMemoryPool, which refuses nothing, and none of them builds a runtime any more, so this is not a refusal admission can meet at any site; - a tree a test assembled directly, whose nodes disagree about their types, which
NativeNode::validaterejects for every compiled one.