Package org.apache.calcite.plan
Class RelOptCluster
java.lang.Object
org.apache.calcite.plan.RelOptCluster
An environment for related relational expressions during the
optimization of a query.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RelOptClustercreate(RelOptPlanner planner, RexBuilder rexBuilder) Creates a cluster.Constructs a new id for a correlating variable.Returns the hint strategies of this cluster.Deprecated.@Nullable RelMetadataProviderReturns the current RelMetadataQuery.Returns the supplier of RelMetadataQuery.Deprecated.getQuery()Deprecated.voidShould be called whenever the currentRelMetadataQuerybecomes invalid.voidsetHintStrategies(HintStrategyTable hintStrategies) Sets up the hint propagation strategies to be used during rule planning.voidsetMetadataProvider(RelMetadataProvider metadataProvider) Overrides the default metadata provider for this cluster.voidsetMetadataQuerySupplier(Supplier<RelMetadataQuery> mqSupplier) Sets up the customizedRelMetadataQueryinstance supplier that to use during rule planning.voidsetOriginalExpression(RexNode originalExpression) Deprecated.traitSet()Returns the default trait set for this cluster.traitSetOf(RelTrait trait) traitSetOf(RelTrait... traits) Deprecated.FortraitSetOf(t1, t2), usetraitSet()().replace(t1).replace(t2).
-
Method Details
-
create
Creates a cluster. -
getQuery
Deprecated. -
getOriginalExpression
Deprecated. -
setOriginalExpression
Deprecated. -
getPlanner
-
getTypeFactory
-
getRexBuilder
-
getMetadataProvider
-
setMetadataProvider
@EnsuresNonNull({"this.metadataProvider","this.metadataFactory"}) public void setMetadataProvider(@UnknownInitialization RelOptCluster this, RelMetadataProvider metadataProvider) Overrides the default metadata provider for this cluster.- Parameters:
metadataProvider- custom provider
-
getMetadataFactory
Deprecated.UsegetMetadataQuery().Returns aMetadataFactory. -
setMetadataQuerySupplier
@EnsuresNonNull("this.mqSupplier") public void setMetadataQuerySupplier(@UnknownInitialization RelOptCluster this, Supplier<RelMetadataQuery> mqSupplier) Sets up the customizedRelMetadataQueryinstance supplier that to use during rule planning.Note that the
mqSuppliershould return a fresh newRelMetadataQueryinstance because the instance would be cached in this cluster, and we may invalidate and re-generate it for eachRelOptRuleCallcycle. -
getMetadataQuery
Returns the current RelMetadataQuery.This method might be changed or moved in future. If you have a
RelOptRuleCallavailable, for example if you are in aRelOptRule.onMatch(RelOptRuleCall)method, then useRelOptRuleCall.getMetadataQuery()instead. -
getMetadataQuerySupplier
Returns the supplier of RelMetadataQuery. -
invalidateMetadataQuery
public void invalidateMetadataQuery()Should be called whenever the currentRelMetadataQuerybecomes invalid. Typically invoked fromRelOptRuleCall.transformTo(org.apache.calcite.rel.RelNode, java.util.Map<org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelHintsPropagator). -
setHintStrategies
Sets up the hint propagation strategies to be used during rule planning.Use
RelOptNode.getCluster().getHintStrategies()to fetch the hint strategies.Note that this method is only for internal use; the cluster
hintStrategieswould be always set up with the instance configured bySqlToRelConverter.Config.- Parameters:
hintStrategies- The specified hint strategies to override the default one(empty)
-
getHintStrategies
Returns the hint strategies of this cluster. It is immutable during the whole planning phrase. -
createCorrel
Constructs a new id for a correlating variable. It is unique within the whole query. -
traitSet
Returns the default trait set for this cluster. -
traitSetOf
Deprecated.FortraitSetOf(t1, t2), usetraitSet()().replace(t1).replace(t2). -
traitSetOf
-
getMetadataQuery().