@Value.Immutable
public static interface RelBuilder.Config
It is immutable, and all fields are public.
Start with the DEFAULT
instance, and call withXxx
methods to set its
properties.
Modifier and Type | Field and Description |
---|---|
static RelBuilder.Config |
DEFAULT
Default configuration.
|
Modifier and Type | Method and Description |
---|---|
default boolean |
aggregateUnique()
Whether to create an Aggregate even if we know that the input is already unique; default
false.
|
default int |
bloat()
Controls whether to merge two
Project operators when inlining expressions causes
complexity to increase. |
default boolean |
dedupAggregateCalls()
Whether
RelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...) should eliminate duplicate aggregate calls; default
true. |
default boolean |
pruneInputOfAggregate()
Whether
RelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...) should prune unused input columns; default true. |
default boolean |
pushJoinCondition()
Whether to push down join conditions; default false (but
SqlToRelConverter.config() by default sets this to true). |
default boolean |
simplify()
Whether to simplify expressions; default true.
|
default boolean |
simplifyLimit()
Whether to simplify LIMIT 0 to an empty relation; default true.
|
default boolean |
simplifyValues()
Whether to simplify
Union(Values, Values) or Union(Project(Values)) to
Values ; default true. |
RelBuilder.Config |
withAggregateUnique(boolean aggregateUnique)
Sets
aggregateUnique() . |
RelBuilder.Config |
withBloat(int bloat)
Sets
bloat() . |
RelBuilder.Config |
withDedupAggregateCalls(boolean dedupAggregateCalls)
Sets
dedupAggregateCalls() . |
RelBuilder.Config |
withPruneInputOfAggregate(boolean pruneInputOfAggregate)
Sets
pruneInputOfAggregate() . |
RelBuilder.Config |
withPushJoinCondition(boolean pushJoinCondition)
Sets
pushJoinCondition() . |
RelBuilder.Config |
withSimplify(boolean simplify)
Sets
simplify() . |
RelBuilder.Config |
withSimplifyLimit(boolean simplifyLimit)
Sets
simplifyLimit() . |
RelBuilder.Config |
withSimplifyValues(boolean simplifyValues)
Sets
simplifyValues() . |
static final RelBuilder.Config DEFAULT
@Value.Default default int bloat()
Project
operators when inlining expressions causes
complexity to increase.
Usually merging projects is beneficial, but occasionally the result is more complex than the original projects. Consider:
P: Project(a+b+c AS x, d+e+f AS y, g+h+i AS z) # complexity 15 Q: Project(x*y*z AS p, x-y-z AS q) # complexity 10 R: Project((a+b+c)*(d+e+f)*(g+h+i) AS s, (a+b+c)-(d+e+f)-(g+h+i) AS t) # complexity 34The complexity of an expression is the number of nodes (leaves and operators). For example,
a+b+c
has complexity 5 (3 field references and 2 calls):
+ / \ + c / \ a b
A negative value never allows merges.
A zero or positive value, bloat
, allows a merge if complexity of the result is
less than or equal to the sum of the complexity of the originals plus bloat
.
The default value, 100, allows a moderate increase in complexity but prevents cases
where complexity would run away into the millions and run out of memory. Moderate
complexity is OK; the implementation, say via EnumerableCalc
, will often gather common
sub-expressions and compute them only once.
RelBuilder.Config withBloat(int bloat)
bloat()
.@Value.Default default boolean dedupAggregateCalls()
RelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...)
should eliminate duplicate aggregate calls; default
true.RelBuilder.Config withDedupAggregateCalls(boolean dedupAggregateCalls)
dedupAggregateCalls()
.@Value.Default default boolean pruneInputOfAggregate()
RelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...)
should prune unused input columns; default true.RelBuilder.Config withPruneInputOfAggregate(boolean pruneInputOfAggregate)
pruneInputOfAggregate()
.@Value.Default default boolean pushJoinCondition()
SqlToRelConverter.config()
by default sets this to true).RelBuilder.Config withPushJoinCondition(boolean pushJoinCondition)
pushJoinCondition()
.@Value.Default default boolean simplify()
RelBuilder.Config withSimplify(boolean simplify)
simplify()
.@Value.Default default boolean simplifyLimit()
RelBuilder.Config withSimplifyLimit(boolean simplifyLimit)
simplifyLimit()
.@Value.Default default boolean simplifyValues()
Union(Values, Values)
or Union(Project(Values))
to
Values
; default true.RelBuilder.Config withSimplifyValues(boolean simplifyValues)
simplifyValues()
.@Value.Default default boolean aggregateUnique()
RelBuilder.Config withAggregateUnique(boolean aggregateUnique)
aggregateUnique()
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.