Package io.substrait.dsl
Class SubstraitBuilder
java.lang.Object
io.substrait.dsl.SubstraitBuilder
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(Expression left, Expression right) aggregate(Function<Rel, Aggregate.Grouping> groupingFn, Function<Rel, List<Aggregate.Measure>> measuresFn, Rel input) aggregate(Function<Rel, Aggregate.Grouping> groupingFn, Function<Rel, List<Aggregate.Measure>> measuresFn, Rel.Remap remap, Rel input) aggregateFn(String urn, String key, Type outputType, Expression... args) and(Expression... args) avg(Expression expr) bool(boolean v) cast(Expression input, Type type) Returns aAggregate.Measurerepresenting the equivalent of aCOUNT(*)SQL aggregation.divide(Expression left, Expression right) equal(Expression left, Expression right) fieldReference(SubstraitBuilder.JoinInput inputs, int index) Creates a field reference for a join operation by index across both left and right relations.fieldReference(Rel input, int index) fieldReference(List<Rel> inputs, int index) fieldReferences(SubstraitBuilder.JoinInput inputs, int... indexes) Creates multiple field references for a join operation by indexes across both left and right relations.fieldReferences(Rel input, int... indexes) fieldReferences(List<Rel> inputs, int... indexes) filter(Function<Rel, Expression> conditionFn, Rel input) fp64(double v) grouping(Expression... expressions) hashJoin(List<Integer> leftKeys, List<Integer> rightKeys, HashJoin.JoinType joinType, Rel left, Rel right) hashJoin(List<Integer> leftKeys, List<Integer> rightKeys, HashJoin.JoinType joinType, Optional<Rel.Remap> remap, Rel left, Rel right) i32(int v) ifClause(Expression condition, Expression then) ifThen(Iterable<? extends Expression.IfClause> ifClauses, Expression elseClause) innerJoin(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Rel.Remap remap, Rel left, Rel right) innerJoin(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Rel left, Rel right) inPredicate(Rel haystack, Expression... needles) join(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Join.JoinType joinType, Rel.Remap remap, Rel left, Rel right) join(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Join.JoinType joinType, Rel left, Rel right) max(Expression expr) measure(AggregateFunctionInvocation aggFn, Expression preMeasureFilter) mergeJoin(List<Integer> leftKeys, List<Integer> rightKeys, MergeJoin.JoinType joinType, Rel left, Rel right) mergeJoin(List<Integer> leftKeys, List<Integer> rightKeys, MergeJoin.JoinType joinType, Optional<Rel.Remap> remap, Rel left, Rel right) min(Expression expr) multiply(Expression left, Expression right) namedScan(Iterable<String> tableName, Iterable<String> columnNames, Iterable<Type> types, Rel.Remap remap) namedUpdate(Iterable<String> tableName, Iterable<String> columnNames, List<AbstractUpdate.TransformExpression> transformations, Expression condition, boolean nullable) namedUpdate(Iterable<String> tableName, Iterable<String> columnNames, List<AbstractUpdate.TransformExpression> transformations, Expression condition, boolean nullable, Rel.Remap remap) namedWrite(Iterable<String> tableName, Iterable<String> columnNames, AbstractWriteRel.WriteOp op, AbstractWriteRel.CreateMode createMode, AbstractWriteRel.OutputMode outputMode, Rel input) namedWrite(Iterable<String> tableName, Iterable<String> columnNames, AbstractWriteRel.WriteOp op, AbstractWriteRel.CreateMode createMode, AbstractWriteRel.OutputMode outputMode, Rel input, Rel.Remap remap) negate(Expression expr) nestedLoopJoin(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, NestedLoopJoin.JoinType joinType, Rel left, Rel right) or(Expression... args) scalarFn(String urn, String key, Type outputType, FunctionArg... args) scalarSubquery(Rel input, Type type) singleOrList(Expression condition, Expression... options) sort(Function<Rel, Iterable<? extends Expression.SortField>> sortFieldFn, Rel.Remap remap, Rel input) sortField(Expression expression, Expression.SortDirection sortDirection) sortFields(Rel input, int... indexes) subtract(Expression left, Expression right) sum(Expression expr) sum0(Expression expr) switchClause(Expression.Literal condition, Expression then) switchExpression(Expression match, Iterable<? extends Expression.SwitchClause> clauses, Expression defaultClause) userDefinedType(String urn, String typeName) windowFn(String urn, String key, Type outputType, Expression.AggregationPhase aggregationPhase, Expression.AggregationInvocation invocation, Expression.WindowBoundsType boundsType, WindowBound lowerBound, WindowBound upperBound, Expression... args)
-
Constructor Details
-
SubstraitBuilder
-
-
Method Details
-
measure
-
measure
-
aggregate
public Aggregate aggregate(Function<Rel, Aggregate.Grouping> groupingFn, Function<Rel, List<Aggregate.Measure>> measuresFn, Rel input) -
aggregate
public Aggregate aggregate(Function<Rel, Aggregate.Grouping> groupingFn, Function<Rel, List<Aggregate.Measure>> measuresFn, Rel.Remap remap, Rel input) -
cross
-
cross
-
fetch
-
fetch
-
limit
-
limit
-
offset
-
offset
-
filter
-
filter
-
innerJoin
public Join innerJoin(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Rel left, Rel right) -
innerJoin
public Join innerJoin(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Rel.Remap remap, Rel left, Rel right) -
join
public Join join(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Join.JoinType joinType, Rel left, Rel right) -
join
public Join join(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, Join.JoinType joinType, Rel.Remap remap, Rel left, Rel right) -
hashJoin
-
hashJoin
-
mergeJoin
-
mergeJoin
-
nestedLoopJoin
public NestedLoopJoin nestedLoopJoin(Function<SubstraitBuilder.JoinInput, Expression> conditionFn, NestedLoopJoin.JoinType joinType, Rel left, Rel right) -
namedScan
-
namedScan
-
emptyVirtualTableScan
-
namedWrite
public NamedWrite namedWrite(Iterable<String> tableName, Iterable<String> columnNames, AbstractWriteRel.WriteOp op, AbstractWriteRel.CreateMode createMode, AbstractWriteRel.OutputMode outputMode, Rel input) -
namedWrite
public NamedWrite namedWrite(Iterable<String> tableName, Iterable<String> columnNames, AbstractWriteRel.WriteOp op, AbstractWriteRel.CreateMode createMode, AbstractWriteRel.OutputMode outputMode, Rel input, Rel.Remap remap) -
namedUpdate
public NamedUpdate namedUpdate(Iterable<String> tableName, Iterable<String> columnNames, List<AbstractUpdate.TransformExpression> transformations, Expression condition, boolean nullable) -
namedUpdate
public NamedUpdate namedUpdate(Iterable<String> tableName, Iterable<String> columnNames, List<AbstractUpdate.TransformExpression> transformations, Expression condition, boolean nullable, Rel.Remap remap) -
project
-
project
-
expand
-
expand
-
set
-
set
-
sort
-
sort
-
bool
-
i32
-
fp64
-
str
-
cast
-
fieldReference
-
fieldReferences
-
fieldReference
Creates a field reference for a join operation by index across both left and right relations. The index spans across the combined schema of both join inputs, where fields from the left relation come first, followed by fields from the right relation.- Parameters:
inputs- the join inputs containing both left and right relationsindex- the zero-based field index across the combined schema of both relations- Returns:
- a
FieldReferencepointing to the specified field in the join context
-
fieldReference
-
fieldReferences
Creates multiple field references for a join operation by indexes across both left and right relations. Each index spans across the combined schema of both join inputs, where fields from the left relation come first, followed by fields from the right relation.- Parameters:
inputs- the join inputs containing both left and right relationsindexes- the zero-based field indexes across the combined schema of both relations- Returns:
- a list of
FieldReferenceobjects pointing to the specified fields in the join context
-
fieldReferences
-
ifThen
public Expression.IfThen ifThen(Iterable<? extends Expression.IfClause> ifClauses, Expression elseClause) -
ifClause
-
singleOrList
-
inPredicate
-
sortFields
-
sortField
public Expression.SortField sortField(Expression expression, Expression.SortDirection sortDirection) -
switchClause
-
switchExpression
public Expression.Switch switchExpression(Expression match, Iterable<? extends Expression.SwitchClause> clauses, Expression defaultClause) -
aggregateFn
public AggregateFunctionInvocation aggregateFn(String urn, String key, Type outputType, Expression... args) -
grouping
-
grouping
-
count
-
countStar
Returns aAggregate.Measurerepresenting the equivalent of aCOUNT(*)SQL aggregation.- Returns:
- the
Aggregate.MeasurerepresentingCOUNT(*)
-
min
-
min
-
max
-
max
-
avg
-
avg
-
sum
-
sum
-
sum0
-
sum0
-
negate
-
add
-
subtract
-
multiply
-
divide
-
equal
-
and
-
or
-
scalarFn
public Expression.ScalarFunctionInvocation scalarFn(String urn, String key, Type outputType, FunctionArg... args) -
windowFn
public Expression.WindowFunctionInvocation windowFn(String urn, String key, Type outputType, Expression.AggregationPhase aggregationPhase, Expression.AggregationInvocation invocation, Expression.WindowBoundsType boundsType, WindowBound lowerBound, WindowBound upperBound, Expression... args) -
userDefinedType
-
root
-
plan
-
remap
-
scalarSubquery
-
exists
-