- All Known Subinterfaces:
ConditionalJoinNode
- All Known Implementing Classes:
AggregationNode,AntiJoinNode,AsOfJoinNode,ClosureNode,ClusterNode,CompositionNode,CoverNode,DifferenceNode,DistinctNode,DivisionNode,DownsampleNode,EmptyRelationNode,FixpointNode,FullOuterJoinNode,IntersectionNode,IntervalJoinNode,IterateNode,LateralJoinNode,LeftOuterJoinNode,LimitNode,NaturalJoinNode,OptimizeNode,OuterUnionNode,PairwiseUniversalNode,PathNode,PivotNode,ProductNode,ProjectionNode,RecursiveRefNode,RelationFunctionCall,RelationNode,RenameNode,ReservoirSampleNode,RightOuterJoinNode,SampleNode,SelectionNode,SemiJoinNode,SessionizeNode,SolveNode,SortNode,SymmetricDifferenceNode,ThetaJoinNode,TopKNode,TraceNode,TreeNode,TruthRelationNode,UnionAllNode,UnionNode,UniversalNode,UnnestNode,UnpivotNode,WhyNode,WindowNode
Every node in the AST implements this interface and participates in the
visitor pattern via accept(com.darkcollective.relix.ast.visitor.RelNodeVisitor<R>). The sealed hierarchy is exhaustive —
all permitted implementations are listed in the permits clause —
so pattern matching and visitor dispatch are guaranteed to be complete at
compile time.
Use prettyPrint() to serialise any node to a Unicode relational
algebra string.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) children()Returns this node's direct child sub-expressions, in left-to-right order.location()Returns the source location of the first token of this node.default RelNodeReturns a copy of this node with each direct child replaced by the result of applyingfto it, preserving all other fields (predicates, attributes, join conditions, source location, …).default MaterializationModeReturns the output materialisation mode of this node.default String
-
Method Details
-
accept
-
location
SourceLocation location()Returns the source location of the first token of this node. -
materializationMode
Returns the output materialisation mode of this node.The default implementation derives the mode from the concrete node type via an exhaustive pattern switch over the sealed hierarchy:
- Returns:
- the materialisation mode; never null
-
prettyPrint
-
children
Returns this node's direct child sub-expressions, in left-to-right order.Leaf nodes (
RelationNode) return an empty list; unary operators return their single input; binary operators return[left, right]. This is the canonical structural-traversal accessor — prefer it over a hand-writtenswitchwhen walking a tree read-only.- Returns:
- an immutable list of direct children; never null, possibly empty
-
mapChildren
Returns a copy of this node with each direct child replaced by the result of applyingfto it, preserving all other fields (predicates, attributes, join conditions, source location, …).As an optimization and a convenient no-op signal, this node is returned unchanged (reference-identical) when
freturns the same reference for every child — so a tree rewrite can detect "nothing changed" with a==check. This is the canonical structural-rewrite helper; prefer it over a hand-written reconstructionswitch.- Parameters:
f- the transformation to apply to each direct child; must not be null- Returns:
- the rewritten node, or
thisif no child changed
-