- Direct Known Subclasses:
Expr,ScriptBuilders
The AST is the engine's public contract, so constructing it must not require the
grammar. These factories are that alternative: every concrete RelNode,
Predicate and Operand kind has one, and AstBuilderCoverageTest
fails the build if a newly permitted kind arrives without it.
The one rule
A factory takes the record's own components minus SourceLocation
— which defaults to SourceLocation.UNKNOWN — arranged so that the
relation inputs sit where the operator's own notation puts them. Where a node
offers a narrower convenience constructor, the factory is overloaded to match it.
That arrangement is decided by the operator, not by the record, because the records
themselves are not consistent about it — most declare the input last, seven declare it
first, and UnnestNode declares it fourth. Reproducing each record's own order
would publish that inconsistency as the thing a caller has to learn. So:
- A leaf takes no relation.
rel("Orders"),unitRel(). - A unary operator's input goes last, after the operator's own arguments, so
the call reads as the operator does:
select(pred, rel("R"))is σpred(R), andclosure("src", "dst", rel("Edges"))is exactly howCLOSURE src, dst (Edges)is written. - A join or set operation's inputs lead, before any modifier, so the call
reads as the infix operator does:
join(left, right, cond)is L ⋈cond R,union(a, b)is A ∪ B. This is what putslateral(left, "f", args)here rather than under (2) — its right input is a table-function call rather than a relation, but it is a join. - A binder precedes what it scopes.
fixpoint(name, base, step)anditerate(name, base, step, stop)are the nodes where a name scopes an input:stepcannot be read without knowing whatnamebinds, so it leads its two relations.
AstBuilderOrderTest holds every factory to this, so the rule is checked
rather than remembered — the four graph operators (closure, cluster,
path, trace) each took their input first until it was, which put them
in silent disagreement with their own surface syntax.
List-valued components are taken as List; the element helpers
(attrs(java.lang.String...), cols(java.lang.String...), asc(java.lang.String), desc(java.lang.String), projected(com.darkcollective.relix.ast.Operand),
agg(com.darkcollective.relix.ast.AggregateOperator, java.lang.String)) are what keep the call sites short:
RelNode plan = project(attrs("dept", "total"),
groupBy(cols("dept"), List.of(agg(AggregateOperator.SUM, "amount")),
select(cmp(attr("status"), ComparisonOperator.EQUAL, str("OPEN")),
rel("Orders"))));
Extend this class to reach the factories unqualified, or import them statically.
This is main source, not a test fixture: building a tree without the
grammar is what the AST being the engine's public contract means, and a
surface published from testFixtures is one embedders were told to use but
could not depend on. The consequence is that these factories carry the same
compatibility promise as the records they build — a renamed record component is a
breaking change here, not a test edit.
For a shorter spelling of the same nodes — eq(attr("id"), num(42)) rather
than cmp(attr("id"), ComparisonOperator.EQUAL, num("42")) — and for building
literals from Java values instead of their source spelling, see Expr, which
extends this class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregateFunctionagg(AggregateOperator operator, String attribute) An unaliased aggregate over a bare column, e.g.static AggregateFunctionagg(AggregateOperator operator, String attribute, String alias) An aliased aggregate over a bare column, e.g.static AggregateFunctionaggOf(AggregateOperator operator, Operand argument) An aggregate over an arbitrary expression, e.g.static AllocationSpecallocation(double lo, double hi, String columnName) AnOPTIMIZEcontinuous-allocation spec.static AndPredicateConjunctionleft ∧ right.static AntiJoinNode▷ — anti join.static AggregateFunctionargAgg(AggregateOperator operator, Operand argument, Operand yieldExpr) A two-argument aggregate, e.g.static AggregateFunctionargAgg(AggregateOperator operator, Operand argument, Operand yieldExpr, String alias) An aliased two-argument aggregate, e.g.static BinaryArithmeticExpressionarith(Operand left, ArithmeticOperator operator, Operand right) A binary arithmetic expression, e.g.static ArrayConstructionAn array construction[a, b, …].static SortSpecificationAn ascending sort key on a bare column.static AsOfJoinNodeAS-OF join, outer, no tolerance, default tie-break.static AsOfJoinNodeasOfJoin(RelNode left, RelNode right, Predicate condition, Optional<Operand> tolerance, boolean inner, TieBreak tieBreak) AS-OF join, fully specified.static AttributeOperandA column reference, e.g.static List<ProjectedAttribute> The projection list for bare column names — the π argument tests write most.static BooleanOperandbool(boolean value) A boolean literal.static ClosureNodeClosure reading its two columns as an undirected edge (a ↔ b).static ClosureNodeclosure(String fromColumn, String toColumn, boolean undirected, boolean reflexive, Optional<Operand> boundSource, Optional<Operand> boundTarget, RelNode input) Closure with the endpoint boundsCLOSURE-001pushes down.static ClosureNodeClosure — reflexive-transitiveR*whenreflexive.static ClosureNodeTransitive closureR⁺.static ClusterNodeConnected components, labelled intolabelColumn.static ComparisonPredicatecmp(Operand left, ComparisonOperator operator, Operand right) A comparison, e.g.A plain list of column names, for the components that take one.static CompositionNodecomposition(RelNode left, RelNode right) ∘ — relational composition.static ConditionOperandA predicate used where an operand is expected, so a boolean can be projected.static OptimizeConstraintconstraint(Operand expr, ComparisonOperator op, double bound) OneOPTIMIZEconstraint, e.g.static CoverNodeCOVER t EXACTwhenexact, which needs an installed solver.static CoverNodeCOVER t— a t-way covering suite.static DateOperandBuilds aDateOperandfrom an ISO-8601 date string, e.g.static SortSpecificationA descending sort key on a bare column.static DifferenceNodedifference(RelNode left, RelNode right) − — difference.static DistinctNodeδ — duplicate elimination.static DivisionNode÷ — division.static DownsampleNodedownsample(String tsCol, String interval, ConsolidationFunction fn, RelNode input) DOWNSAMPLE— consolidate into time buckets.static DownsampleNodedownsample(String tsCol, String interval, ConsolidationFunction fn, List<String> keys, long maxRows, RelNode input) DOWNSAMPLEwith a target row budget.static DownsampleNodedownsample(String tsCol, String interval, ConsolidationFunction fn, List<String> keys, RelNode input) DOWNSAMPLEwithin each group.static DownsampleNodedownsample(String tsCol, String interval, ConsolidationFunction fn, List<String> keys, OptionalLong maxRows, RelNode input) DOWNSAMPLEwith the row budget already in the form the node holds.static DurationOperandBuilds aDurationOperandfrom an ISO-8601 duration string, e.g.static ElementOfPredicateMembershipelement ∈ setExpression.static EmptyRelationNodeThe optimizer's ∅ — no rows, carryingheading's schema.static TruthRelationNodeemptyRel()The zero-tuple truth relationEMPTY(DUM).static StructConstruction.FieldOne field of astructOf(com.darkcollective.relix.ast.StructConstruction.Field...)construction.static FixpointNodeFIX— a monotone least fixpoint overbaseandstep.static FullOuterJoinNode⟗ — full outer join.static FunctionCallA scalar function call, e.g.static AggregationNodeγ — aggregation grouped by bare columns.static AggregationNodegroupByKeys(List<GroupingKey> groupingKeys, List<AggregateFunction> aggregates, RelNode input) γ — aggregation grouped by arbitrary key expressions.static IntersectionNodeintersection(RelNode left, RelNode right) ∩ — intersection.static IntervalJoinNodeintervalJoin(RelNode left, RelNode right, AllenRelation relation, String leftStart, String leftEnd, String rightStart, String rightEnd) Interval join over an Allen relation between two[start, end]column pairs.static IterateNodeiterate(String name, RelNode base, RelNode step, IterateStop stop) ITERATE— a replace-each-round iteration overbaseandstep.static ThetaJoinNode⨝ — theta join.static GroupingKeyA grouping key on an arbitrary expression, e.g.static GroupingKeyA grouping key on a bare column.static LateralJoinNodeLATERAL— a TVF call evaluated per left row.static LeftOuterJoinNode⟕ — left outer join.static PatternPredicateSQLLIKE.static LimitNodeλ — limit, no offset.static LimitNodeλ — limit with an offset.static NaturalJoinNodenaturalJoin(RelNode left, RelNode right) ⋈ — natural join.static NotPredicateNegation¬predicate.static ElementOfPredicatenotElementOf(Operand element, Operand setExpression) Non-membershipelement ∉ setExpression.static PatternPredicateSQLNOT LIKE.static NullPredicateIS NULLwhenisNull,IS NOT NULLotherwise.static NumberOperandA numeric literal, spelled as written —"5"and"5.0"differ.static OptimizeNodeoptimize(ObjectiveSense sense, Operand objective, List<OptimizeConstraint> constraints, List<String> groupingKeys, RelNode input) OPTIMIZE— subset selection (MIP mode).static OptimizeNodeoptimize(ObjectiveSense sense, Operand objective, List<OptimizeConstraint> constraints, List<String> groupingKeys, Optional<AllocationSpec> allocation, RelNode input) OPTIMIZEwith a continuous-allocation spec (LP mode).static OrPredicateDisjunctionleft ∨ right.static OuterUnionNodeouterUnion(RelNode left, RelNode right) ⊔ — outer union over differing headings.static PairwiseUniversalNodepairwiseUniversal(RelNode left, RelNode right, Predicate condition) The pairwise ∀ semi-join.static PathNodepath(String fromColumn, String toColumn, boolean undirected, int minHops, int maxHops, String depthColumn, RelNode input) Bounded-hop paths over an undirected edge relation (a ↔ b).static PathNodepath(String fromColumn, String toColumn, boolean undirected, int minHops, int maxHops, String depthColumn, Optional<Operand> boundSource, Optional<Operand> boundTarget, RelNode input) Path with the endpoint boundsPATH-001pushes down.static PathNodepath(String fromColumn, String toColumn, int minHops, int maxHops, String depthColumn, RelNode input) Bounded-hop paths, with the hop count indepthColumn.static PivotNodePIVOT— spreadvalueColumnacross the values ofkeyColumn.static ProduceBoundproduceBound(String column, ComparisonOperator operator, Operand limit) A generator's produce bound, e.g.static ProductNode× — Cartesian product.static ProjectionNodeproject(List<ProjectedAttribute> attributes, RelNode input) π — projection.static ProjectedAttributeAn unaliased projected expression.static ProjectedAttributeAn aliased projected expression,expression → alias.static RecursiveRefNodeA reference to the enclosingFIXaccumulator.static RelationNodeA base-relation reference.static RelationNoderel(String name, ProduceBound bound) A generator reference carrying a produce bound.static RenameNodeρ — rename the relation and, optionally, all its columns positionally.static RenameNoderename(Optional<String> relationName, List<String> attributes, List<RenameNode.RenamePair> pairs, RelNode input) ρ — the general form: optional relation name, positional attributes, andfrom → topairs.static RenameNode.RenamePairrenamePair(String from, String to) One column renamefrom → to, for the pair form of ρ.static ReservoirSampleNodereservoirSample(long count, RelNode input) SAMPLE n— reservoir sampling of a fixed row count.static ReservoirSampleNodereservoirSample(long count, Optional<Long> seed, RelNode input) SAMPLE nwith a seed.static RightOuterJoinNode⟖ — right outer join.static IterateStop.Roundsrounds(int n) static SampleNodeSAMPLE— Bernoulli sampling, unseeded and therefore volatile.static SampleNodeSAMPLEwith a seed, which makes it reproducible.static SelectionNodeσ — selection.static SemiJoinNode⋉ — semi join.static SessionizeNodesessionize(String orderColumn, Operand threshold, String sessionColumn, RelNode input) SESSIONIZE— gap-based sessions, unpartitioned.static SessionizeNodesessionize(String orderColumn, Operand threshold, List<String> partitionKeys, String sessionColumn, RelNode input) SESSIONIZE— gap-based sessions within each partition.static SetLiteralOperandA set literal, the right-hand side ofIN.static SolveNodeSOLVE— invert an equation for its single unknown.static SortNodesort(List<SortSpecification> sortSpecs, RelNode input) τ — sort.static SortSpecificationsortKey(Operand expression, SortDirection direction) A sort key on an arbitrary expression.static StringOperandA string literal.static StructConstructionstructOf(StructConstruction.Field... fields) A struct construction{name: expr, …}.static SymmetricDifferenceNodesymmetricDifference(RelNode left, RelNode right) ∆ — symmetric difference.static TimeOperandBuilds aTimeOperandfrom an ISO-8601 time string, e.g.static TimestampOperandBuilds aTimestampOperandfrom an ISO-8601 timestamp string, UTC-normalised, e.g.static TopKNodeTOP— the firstcountrows of each partition.static TopKNodetopK(List<String> groupingAttributes, List<SortSpecification> sortSpecs, Optional<Long> offset, long count, RelNode input) TOPwith an offset.static TraceNodetrace(String from, String to, boolean undirected, String weight, ObjectiveSense sense, String path, RelNode input) Trace over an undirected weighted edge relation (a ↔ b).static TraceNodetrace(String from, String to, boolean undirected, String weight, ObjectiveSense sense, String path, Optional<Operand> boundSource, Optional<Operand> boundTarget, RelNode input) Trace with the endpoint boundsTRACE-001pushes down.static TraceNodeWeighted shortest/longest path, appendingpathColumn.static TreeNodeTREE— fold an adjacency list into a forest of nested documents.static TreeNodetree(String keyColumn, String parentColumn, List<SortSpecification> orderSpecs, String childrenColumn, RelNode input) TREEwith sibling ordering.static RelationFunctionCallA table-valued function call,f(args…).static UnaryOperandArithmetic negation of an operand.static UnionNode∪ — set union.static UnionAllNode⊎ — bag union, keeping duplicates.static TruthRelationNodeunitRel()The one-tuple truth relationUNIT(DEE).static UniversalNode∀ — universal quantification over grouping columns.static UnnestNodeμ — unnest, keeping rows whose array is empty whenouter.static UnnestNodeμ — unnest with an ordinality column.static UnnestNodeμ — unnest an array column.static UnpivotNodeUNPIVOT— foldcolumnsinto a name/value pair.static IterateStop.ConvergeduntilConverged(List<String> columns, BigDecimal tolerance, List<String> keys, int maxRounds) UNTIL c, … WITHIN ε PER k, … MAX n ROUNDS— anIterateStopending on numeric convergence.static IterateStop.StableuntilStable(int maxRounds) UNTIL STABLE MAX n ROUNDS— anIterateStopending at the first unchanged round.static WhyNodeω — reify each tuple's lineage as a nestedprovenancecolumn.static WindowNodewindow(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input) WINDOW/ROLLING— one window function intooutputColumn.
-
Constructor Details
-
AstBuilders
public AstBuilders()
-
-
Method Details
-
attr
A column reference, e.g.amount. -
num
A numeric literal, spelled as written —"5"and"5.0"differ. -
str
A string literal. -
bool
A boolean literal. -
date
Builds aDateOperandfrom an ISO-8601 date string, e.g."2026-06-15". -
time
Builds aTimeOperandfrom an ISO-8601 time string, e.g."13:40:00". -
timestamp
Builds aTimestampOperandfrom an ISO-8601 timestamp string, UTC-normalised, e.g."2026-06-15T13:40:00Z". -
duration
Builds aDurationOperandfrom an ISO-8601 duration string, e.g."PT30M". -
arith
public static BinaryArithmeticExpression arith(Operand left, ArithmeticOperator operator, Operand right) A binary arithmetic expression, e.g.price * qty. -
func
A scalar function call, e.g.Abs(delta). -
set
A set literal, the right-hand side ofIN. -
arrayOf
An array construction[a, b, …]. -
field
One field of astructOf(com.darkcollective.relix.ast.StructConstruction.Field...)construction. -
structOf
A struct construction{name: expr, …}. -
unary
Arithmetic negation of an operand. -
condition
A predicate used where an operand is expected, so a boolean can be projected. -
cmp
A comparison, e.g.amount > 100. -
and
Conjunctionleft ∧ right. -
or
Disjunctionleft ∨ right. -
not
Negation¬predicate. -
nullPred
IS NULLwhenisNull,IS NOT NULLotherwise. -
elementOf
Membershipelement ∈ setExpression. -
notElementOf
Non-membershipelement ∉ setExpression. -
like
SQLLIKE. -
notLike
SQLNOT LIKE. -
projected
An unaliased projected expression. -
projected
An aliased projected expression,expression → alias. -
attrs
The projection list for bare column names — the π argument tests write most. -
cols
A plain list of column names, for the components that take one. -
asc
An ascending sort key on a bare column. -
desc
A descending sort key on a bare column. -
sortKey
A sort key on an arbitrary expression. -
agg
An unaliased aggregate over a bare column, e.g.SUM(amount). -
agg
An aliased aggregate over a bare column, e.g.SUM(amount) → total. -
aggOf
An aggregate over an arbitrary expression, e.g.SUM(price * qty). -
argAgg
public static AggregateFunction argAgg(AggregateOperator operator, Operand argument, Operand yieldExpr) A two-argument aggregate, e.g.ARGMAX(rank, name)— the value ofyieldExprfrom the row whereargumentis the group extremum. -
argAgg
public static AggregateFunction argAgg(AggregateOperator operator, Operand argument, Operand yieldExpr, String alias) An aliased two-argument aggregate, e.g.ARGMAX(rank, name) → top. -
key
A grouping key on a bare column. -
key
A grouping key on an arbitrary expression, e.g.YEAR(order_date) → yr. -
renamePair
One column renamefrom → to, for the pair form of ρ. -
produceBound
A generator's produce bound, e.g.n < 100. -
constraint
OneOPTIMIZEconstraint, e.g.SUM(cost) ≤ 50. -
allocation
AnOPTIMIZEcontinuous-allocation spec. -
rel
A base-relation reference. -
rel
A generator reference carrying a produce bound. -
tvf
A table-valued function call,f(args…). -
unitRel
The one-tuple truth relationUNIT(DEE). -
emptyRel
The zero-tuple truth relationEMPTY(DUM). -
emptyOf
The optimizer's ∅ — no rows, carryingheading's schema. The heading is an inert component rather than a child, so it is invisible to structural traversal. -
recRef
A reference to the enclosingFIXaccumulator. -
select
σ — selection. -
project
π — projection. -
rename
ρ — rename the relation and, optionally, all its columns positionally. -
rename
public static RenameNode rename(Optional<String> relationName, List<String> attributes, List<RenameNode.RenamePair> pairs, RelNode input) ρ — the general form: optional relation name, positional attributes, andfrom → topairs. -
groupBy
public static AggregationNode groupBy(List<String> groupingColumns, List<AggregateFunction> aggregates, RelNode input) γ — aggregation grouped by bare columns. -
groupByKeys
public static AggregationNode groupByKeys(List<GroupingKey> groupingKeys, List<AggregateFunction> aggregates, RelNode input) γ — aggregation grouped by arbitrary key expressions. -
sort
τ — sort. -
limit
λ — limit, no offset. -
limit
λ — limit with an offset. -
distinct
δ — duplicate elimination. -
unnest
μ — unnest an array column. -
unnest
μ — unnest, keeping rows whose array is empty whenouter. -
unnest
public static UnnestNode unnest(String column, boolean outer, Optional<String> ordinalityColumn, RelNode input) μ — unnest with an ordinality column. -
universal
public static UniversalNode universal(List<String> groupingAttributes, Predicate predicate, RelNode input) ∀ — universal quantification over grouping columns. -
why
ω — reify each tuple's lineage as a nestedprovenancecolumn. -
naturalJoin
⋈ — natural join. -
join
⨝ — theta join. -
leftJoin
⟕ — left outer join. -
rightJoin
⟖ — right outer join. -
fullJoin
⟗ — full outer join. -
semiJoin
⋉ — semi join. -
antiJoin
▷ — anti join. -
pairwiseUniversal
public static PairwiseUniversalNode pairwiseUniversal(RelNode left, RelNode right, Predicate condition) The pairwise ∀ semi-join. -
asOfJoin
AS-OF join, outer, no tolerance, default tie-break. -
asOfJoin
public static AsOfJoinNode asOfJoin(RelNode left, RelNode right, Predicate condition, Optional<Operand> tolerance, boolean inner, TieBreak tieBreak) AS-OF join, fully specified. -
intervalJoin
public static IntervalJoinNode intervalJoin(RelNode left, RelNode right, AllenRelation relation, String leftStart, String leftEnd, String rightStart, String rightEnd) Interval join over an Allen relation between two[start, end]column pairs. -
lateral
LATERAL— a TVF call evaluated per left row. -
product
× — Cartesian product. -
union
∪ — set union. -
unionAll
⊎ — bag union, keeping duplicates. -
outerUnion
⊔ — outer union over differing headings. -
difference
− — difference. -
intersection
∩ — intersection. -
division
÷ — division. -
symmetricDifference
∆ — symmetric difference. -
composition
∘ — relational composition. -
closure
Transitive closureR⁺. -
closure
public static ClosureNode closure(String fromColumn, String toColumn, boolean reflexive, RelNode input) Closure — reflexive-transitiveR*whenreflexive. -
closure
public static ClosureNode closure(String fromColumn, String toColumn, boolean undirected, boolean reflexive, RelNode input) Closure reading its two columns as an undirected edge (a ↔ b). -
closure
public static ClosureNode closure(String fromColumn, String toColumn, boolean undirected, boolean reflexive, Optional<Operand> boundSource, Optional<Operand> boundTarget, RelNode input) Closure with the endpoint boundsCLOSURE-001pushes down. -
cluster
public static ClusterNode cluster(String fromColumn, String toColumn, String labelColumn, RelNode input) Connected components, labelled intolabelColumn. -
path
public static PathNode path(String fromColumn, String toColumn, int minHops, int maxHops, String depthColumn, RelNode input) Bounded-hop paths, with the hop count indepthColumn. -
path
public static PathNode path(String fromColumn, String toColumn, boolean undirected, int minHops, int maxHops, String depthColumn, RelNode input) Bounded-hop paths over an undirected edge relation (a ↔ b). -
path
public static PathNode path(String fromColumn, String toColumn, boolean undirected, int minHops, int maxHops, String depthColumn, Optional<Operand> boundSource, Optional<Operand> boundTarget, RelNode input) Path with the endpoint boundsPATH-001pushes down. -
trace
public static TraceNode trace(String from, String to, String weight, ObjectiveSense sense, String path, RelNode input) Weighted shortest/longest path, appendingpathColumn. -
trace
public static TraceNode trace(String from, String to, boolean undirected, String weight, ObjectiveSense sense, String path, RelNode input) Trace over an undirected weighted edge relation (a ↔ b). -
trace
public static TraceNode trace(String from, String to, boolean undirected, String weight, ObjectiveSense sense, String path, Optional<Operand> boundSource, Optional<Operand> boundTarget, RelNode input) Trace with the endpoint boundsTRACE-001pushes down. -
fixpoint
FIX— a monotone least fixpoint overbaseandstep. -
iterate
ITERATE— a replace-each-round iteration overbaseandstep. -
rounds
-
untilStable
UNTIL STABLE MAX n ROUNDS— anIterateStopending at the first unchanged round. -
untilConverged
public static IterateStop.Converged untilConverged(List<String> columns, BigDecimal tolerance, List<String> keys, int maxRounds) UNTIL c, … WITHIN ε PER k, … MAX n ROUNDS— anIterateStopending on numeric convergence. -
window
public static WindowNode window(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input) WINDOW/ROLLING— one window function intooutputColumn. -
topK
public static TopKNode topK(List<String> groupingAttributes, List<SortSpecification> sortSpecs, long count, RelNode input) TOP— the firstcountrows of each partition. -
topK
public static TopKNode topK(List<String> groupingAttributes, List<SortSpecification> sortSpecs, Optional<Long> offset, long count, RelNode input) TOPwith an offset. -
sessionize
public static SessionizeNode sessionize(String orderColumn, Operand threshold, String sessionColumn, RelNode input) SESSIONIZE— gap-based sessions, unpartitioned. -
sessionize
public static SessionizeNode sessionize(String orderColumn, Operand threshold, List<String> partitionKeys, String sessionColumn, RelNode input) SESSIONIZE— gap-based sessions within each partition. -
downsample
public static DownsampleNode downsample(String tsCol, String interval, ConsolidationFunction fn, RelNode input) DOWNSAMPLE— consolidate into time buckets. -
downsample
public static DownsampleNode downsample(String tsCol, String interval, ConsolidationFunction fn, List<String> keys, RelNode input) DOWNSAMPLEwithin each group. -
downsample
public static DownsampleNode downsample(String tsCol, String interval, ConsolidationFunction fn, List<String> keys, long maxRows, RelNode input) DOWNSAMPLEwith a target row budget. -
downsample
public static DownsampleNode downsample(String tsCol, String interval, ConsolidationFunction fn, List<String> keys, OptionalLong maxRows, RelNode input) DOWNSAMPLEwith the row budget already in the form the node holds. -
pivot
public static PivotNode pivot(String valueColumn, String keyColumn, List<String> groupKeys, RelNode input) PIVOT— spreadvalueColumnacross the values ofkeyColumn. -
unpivot
public static UnpivotNode unpivot(List<String> columns, String nameColumn, String valueColumn, RelNode input) UNPIVOT— foldcolumnsinto a name/value pair. -
tree
public static TreeNode tree(String keyColumn, String parentColumn, String childrenColumn, RelNode input) TREE— fold an adjacency list into a forest of nested documents. -
tree
public static TreeNode tree(String keyColumn, String parentColumn, List<SortSpecification> orderSpecs, String childrenColumn, RelNode input) TREEwith sibling ordering. -
sample
SAMPLE— Bernoulli sampling, unseeded and therefore volatile. -
sample
SAMPLEwith a seed, which makes it reproducible. -
reservoirSample
SAMPLE n— reservoir sampling of a fixed row count. -
reservoirSample
SAMPLE nwith a seed. -
solve
SOLVE— invert an equation for its single unknown. -
optimize
public static OptimizeNode optimize(ObjectiveSense sense, Operand objective, List<OptimizeConstraint> constraints, List<String> groupingKeys, RelNode input) OPTIMIZE— subset selection (MIP mode). -
optimize
public static OptimizeNode optimize(ObjectiveSense sense, Operand objective, List<OptimizeConstraint> constraints, List<String> groupingKeys, Optional<AllocationSpec> allocation, RelNode input) OPTIMIZEwith a continuous-allocation spec (LP mode). -
cover
COVER t— a t-way covering suite. -
cover
COVER t EXACTwhenexact, which needs an installed solver.
-