Interface RelBuilder.Config
-
- Enclosing class:
- RelBuilder
@Immutable public static interface RelBuilder.Config
Configuration of RelBuilder.It is immutable, and all fields are public.
Start with the
DEFAULT
instance, and callwithXxx
methods to set its properties.
-
-
Field Summary
Fields Modifier and Type Field Description static RelBuilder.Config
DEFAULT
Default configuration.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method 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 twoProject
operators when inlining expressions causes complexity to increase.default boolean
dedupAggregateCalls()
WhetherRelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...)
should eliminate duplicate aggregate calls; default true.default boolean
pruneInputOfAggregate()
WhetherRelBuilder.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 (butSqlToRelConverter.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 simplifyUnion(Values, Values)
orUnion(Project(Values))
toValues
; default true.RelBuilder.Config
withAggregateUnique(boolean aggregateUnique)
SetsaggregateUnique()
.RelBuilder.Config
withBloat(int bloat)
Setsbloat()
.RelBuilder.Config
withDedupAggregateCalls(boolean dedupAggregateCalls)
SetsdedupAggregateCalls()
.RelBuilder.Config
withPruneInputOfAggregate(boolean pruneInputOfAggregate)
SetspruneInputOfAggregate()
.RelBuilder.Config
withPushJoinCondition(boolean pushJoinCondition)
SetspushJoinCondition()
.RelBuilder.Config
withSimplify(boolean simplify)
Setssimplify()
.RelBuilder.Config
withSimplifyLimit(boolean simplifyLimit)
SetssimplifyLimit()
.RelBuilder.Config
withSimplifyValues(boolean simplifyValues)
SetssimplifyValues()
.
-
-
-
Field Detail
-
DEFAULT
static final RelBuilder.Config DEFAULT
Default configuration.
-
-
Method Detail
-
bloat
@Default default int bloat()
Controls whether to merge twoProject
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 34
The 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 plusbloat
.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.
-
withBloat
RelBuilder.Config withBloat(int bloat)
Setsbloat()
.
-
dedupAggregateCalls
@Default default boolean dedupAggregateCalls()
WhetherRelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...)
should eliminate duplicate aggregate calls; default true.
-
withDedupAggregateCalls
RelBuilder.Config withDedupAggregateCalls(boolean dedupAggregateCalls)
SetsdedupAggregateCalls()
.
-
pruneInputOfAggregate
@Default default boolean pruneInputOfAggregate()
WhetherRelBuilder.aggregate(org.apache.calcite.tools.RelBuilder.GroupKey, org.apache.calcite.tools.RelBuilder.AggCall...)
should prune unused input columns; default true.
-
withPruneInputOfAggregate
RelBuilder.Config withPruneInputOfAggregate(boolean pruneInputOfAggregate)
SetspruneInputOfAggregate()
.
-
pushJoinCondition
@Default default boolean pushJoinCondition()
Whether to push down join conditions; default false (butSqlToRelConverter.config()
by default sets this to true).
-
withPushJoinCondition
RelBuilder.Config withPushJoinCondition(boolean pushJoinCondition)
SetspushJoinCondition()
.
-
simplify
@Default default boolean simplify()
Whether to simplify expressions; default true.
-
withSimplify
RelBuilder.Config withSimplify(boolean simplify)
Setssimplify()
.
-
simplifyLimit
@Default default boolean simplifyLimit()
Whether to simplify LIMIT 0 to an empty relation; default true.
-
withSimplifyLimit
RelBuilder.Config withSimplifyLimit(boolean simplifyLimit)
SetssimplifyLimit()
.
-
simplifyValues
@Default default boolean simplifyValues()
Whether to simplifyUnion(Values, Values)
orUnion(Project(Values))
toValues
; default true.
-
withSimplifyValues
RelBuilder.Config withSimplifyValues(boolean simplifyValues)
SetssimplifyValues()
.
-
aggregateUnique
@Default default boolean aggregateUnique()
Whether to create an Aggregate even if we know that the input is already unique; default false.
-
withAggregateUnique
RelBuilder.Config withAggregateUnique(boolean aggregateUnique)
SetsaggregateUnique()
.
-
-