- All Known Implementing Classes:
PhysicalNode.Aggregate,PhysicalNode.AsOfJoin,PhysicalNode.BernoulliSample,PhysicalNode.Closure,PhysicalNode.Cluster,PhysicalNode.ConstructiveCover,PhysicalNode.Cover,PhysicalNode.Distinct,PhysicalNode.Division,PhysicalNode.Downsample,PhysicalNode.Empty,PhysicalNode.Fixpoint,PhysicalNode.IntervalJoin,PhysicalNode.Iterate,PhysicalNode.Join,PhysicalNode.LateralJoin,PhysicalNode.Limit,PhysicalNode.Optimize,PhysicalNode.Path,PhysicalNode.Pivot,PhysicalNode.Project,PhysicalNode.PushedScan,PhysicalNode.RecursiveRef,PhysicalNode.Rename,PhysicalNode.ReservoirSample,PhysicalNode.Scan,PhysicalNode.Select,PhysicalNode.Sessionize,PhysicalNode.SetOp,PhysicalNode.Solve,PhysicalNode.Sort,PhysicalNode.Spool,PhysicalNode.TopK,PhysicalNode.Trace,PhysicalNode.Tree,PhysicalNode.Universal,PhysicalNode.Unnest,PhysicalNode.Unpivot,PhysicalNode.Why,PhysicalNode.Window
RelNode tree, produced by the
Planner.
Where the logical tree describes what to compute, the physical plan
fixes how: the PhysicalNode.Join node records the chosen
PhysicalNode.JoinAlgorithm and PhysicalNode.BuildSide, and every node carries its already
resolved output schema() so the executor never has to re-infer schemas
or look them up by node identity.
The hierarchy is sealed; the permitted operators are declared as nested
records. Operators with no physical choice (PhysicalNode.Select, PhysicalNode.Project,
PhysicalNode.Rename, PhysicalNode.Aggregate, PhysicalNode.Sort, PhysicalNode.Limit, PhysicalNode.Distinct,
PhysicalNode.SetOp, PhysicalNode.Division) mirror their logical counterparts one-to-one;
PhysicalNode.Join consolidates every join flavour (including Cartesian product) plus
the physical strategy; PhysicalNode.Scan is the leaf that reads a base relation.
Views are inlined by the planner, so they never appear as a node.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordAggregation (γ) — groups bygroupingKeysand reduces each group withaggregates.static final recordAS-OF join — a temporal "pick the nearest right row by time" join.static final recordBernoulli sampling (SAMPLE p [SEED n]): keeps each row ofinputindependently with probabilityprobability.static enumWhich input a join materialises (hashes, or buffers for nested-loop).static final recordTransitive closure (least fixpoint) of theinputedge relation overPhysicalNode.Closure.fromColumn()/PhysicalNode.Closure.toColumn().static final recordConnected-components labelling (CLUSTER) of theinputedge relation, read as undirected edges overPhysicalNode.Cluster.fromColumn()/PhysicalNode.Cluster.toColumn().static final recordConstructive covering reduction (COVER, constructive mode): builds candidate rows value-by-value over thePhysicalNode.ConstructiveCover.factorsdomains, usingPhysicalNode.ConstructiveCover.conjunctsas a validity oracle, never materialising the full Cartesian product.static final recordCovering reduction (COVER): keeps a near-minimal subset ofinputrows such that every distinct t-column value combination (PhysicalNode.Cover.strength-way tuple) occurring in the input occurs in the output.static final recordDistinct (δ) — eliminates duplicate rows.static final recordstatic final recordTime-series downsampling (DOWNSAMPLE): groups input rows into fixed-width time buckets and consolidates numeric columns using the chosenConsolidationFunction.static final recordProduces no rows at all, underschema's heading — the physical form ofEmptyRelationNode, planted by the optimizer where a sub-tree was proved unsatisfiable.static final recordGeneral monotone recursion (FIX): computes the semi-naïve least-fixpoint ofPhysicalNode.Fixpoint.step()seeded byPhysicalNode.Fixpoint.base(), with the relation namedPhysicalNode.Fixpoint.name()bound to the current delta during each step evaluation.static final recordInterval join — tests each pair of rows against an Allen interval algebra relation.static final recordReplace-each-round iteration (ITERATE): evaluatesPhysicalNode.Iterate.base(), then evaluatesPhysicalNode.Iterate.step()with the relation namedPhysicalNode.Iterate.name()bound to the previous round's whole output, replacing it each round, untilPhysicalNode.Iterate.stop()is satisfied.static final recordA join of any kind, carrying the chosen physical strategy.static enumHow a join is executed.static final recordEqui-join key columns:left.get(i)andright.get(i)are the positions, in the left and right inputs, of thei-th equated column pair.static enumThe join flavour.static final recordLateral / correlated table-valued function join: for each row ofPhysicalNode.LateralJoin.left(), evaluates thePhysicalNode.LateralJoin.arguments()in that row's context, binds them into the function body viaPhysicalNode.LateralJoin.bodyBuilder(), plans the instantiated body, and concatenates the left row with each row the body produces.static final recordLimit (λ) — takes a prefix of the input; preserves the input's delivered ordering.static final recordDeclarative optimisation (OPTIMIZE): within each group (bygroupingKeys) either selects the optimal subset (MIP, whenallocationis empty) or assigns continuous allocations (LP, whenallocationis present).static final recordBounded variable-length path reachability (PATH) over theinputedge relation, read overPhysicalNode.Path.fromColumn()/PhysicalNode.Path.toColumn()as directed edges, or as undirected ones whenPhysicalNode.Path.undirected().static final recordRows-to-columns rotation (PIVOT): groups the input by the optionalgroupKeys, then turns each distinct value ofkeyColumninto a new output column whose cell is the correspondingvalueColumncell (NULL when the group has no row for that key).static final recordstatic final recordA leaf that pushes a relational sub-expression down to a connector as a single native query.static final recordA reference to the relation bound by an enclosingPhysicalNode.FixpointorPhysicalNode.Iterate.static final recordRelation/column rename — a metadata-only relabel toPhysicalNode.Rename.schema().static final recordReservoir (fixed-count) sampling (SAMPLE … ROWS [SEED n]): keeps exactlycountrows ofinput, chosen uniformly at random without replacement (or the whole input when it has fewer rows).static final recordReads a base relation: inline rows, or an external source/database via the connector.static final recordSelection (σ) — streaming row filter; preserves the input's delivered ordering.static final recordGap-and-island / sessionization (SESSIONIZE): within each partition (bypartitionKeys) orders rows ascending byorderColumnand appends a 1-based session-id column (sessionColumn), incremented whenever the gap to the prior row exceedsthreshold.static enumThe set-operation flavour.static final recordstatic final recordGoal-seek (SOLVE): for each row ofinput, fills the single NULL column participating in the equationleft = rightby inverting the arithmetic.static final recordSort (τ) — establishes ordering on its sort keys.static final recordMarks a sub-plan whose rows are computed once and read by more than one consumer.static final recordTop-k per group: within each partition (bygroupingAttributes) keeps thecountrows highest bysortSpecs, after skippingoffset.static final recordOptimal-path extraction (TRACE) over theinputweighted edge relation, read as directed edges or, whenPhysicalNode.Trace.undirected(), as undirected ones.static final recordAdjacency-to-forest nesting (TREE): folds the adjacency relationinput(with node keykeyColumnand parent keyparentColumn) into a forest of nested documents — one output row per root, each carrying its subtree in the appendedchildrenColumnarray (siblings ordered byorderSpecs, empty = input order).static final recordGroup-wise universal quantification (∀): keeps the grouping-key tuple of each group in which every row ofinputsatisfiespredicate(strict NULL semantics — an UNKNOWN row disqualifies its group).static final recordUnnest (μ) — explodes the array-valuedcolumninto one row per element;outerkeeps a NULL-bound row when the array is empty/missing.static final recordColumn-to-rows rotation (UNPIVOT): folds the listed columns into rows — each input row fans out to one output row per listed column, with the column name placed innameColumn(STRING) and the cell value invalueColumn(ANY).static final recordLineage reification (WHY): emits every result tuple of its input unchanged plus the reservedprovenance:ANYcolumn holding that tuple's lineage polynomial as a nested document.static final recordWindow (ROLLING / WINDOW): adds one computed column (outputColumn) to every input row, partitioned bypartitionKeysand ordered within each partition bysortSpecs. -
Method Summary
Modifier and TypeMethodDescriptionchildren()Direct child plans, left-to-right; empty for aPhysicalNode.Scan.default OrderingTheOrderingthat this node delivers on its output stream.default PhysicalNodeReturns this node with each direct child replaced by the result of applyingfto it, preserving every other component — schema, join algorithm, predicates, keys, bounds.schema()The output schema of this node; resolved at planning time.
-
Method Details
-
schema
Schema schema()The output schema of this node; resolved at planning time. -
children
List<PhysicalNode> children()Direct child plans, left-to-right; empty for aPhysicalNode.Scan. -
mapChildren
Returns this node with each direct child replaced by the result of applyingfto it, preserving every other component — schema, join algorithm, predicates, keys, bounds.The structural-rewrite helper
RelNodehas had all along, and the same contract: this node is returned reference-identical whenfreturns the same reference for every child, so a rewrite can detect "nothing changed" with a==check, and a sub-tree nothing touched is shared rather than copied.It exists because a plan is otherwise only readable, not rewritable: asking what the same query answers under a different join algorithm means rebuilding the spine above the join that changed, and the alternative is a reconstruction
switchper caller — which is the shape that has twice been found silently dropping a component."Child" means what
children()means, so the two cannot disagree: aWhy's logical sub-tree and aLateralJoin's per-row body are not children of the physical plan and are carried through untouched.- Parameters:
f- the transformation to apply to each direct child; must not be null- Returns:
- the rewritten node, or
thisif no child changed
-
deliveredOrdering
TheOrderingthat this node delivers on its output stream. The default implementation returnsOrdering.none()— meaning no guaranteed row order — which is the conservative safe answer for any operator that does not propagate or establish an ordering. Individual nodes that do preserve order (PhysicalNode.Select,PhysicalNode.Limit) or establish it (PhysicalNode.Sort) override this method.- Returns:
- the delivered ordering; never null
-