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 RelOptCluster
create
(RelOptPlanner planner, RexBuilder rexBuilder) Creates a cluster.Constructs a new id for a correlating variable.Returns the hint strategies of this cluster.Deprecated.@Nullable RelMetadataProvider
Returns the current RelMetadataQuery.Returns the supplier of RelMetadataQuery.Deprecated.getQuery()
Deprecated.void
Should be called whenever the currentRelMetadataQuery
becomes invalid.void
setHintStrategies
(HintStrategyTable hintStrategies) Sets up the hint propagation strategies to be used during rule planning.void
setMetadataProvider
(RelMetadataProvider metadataProvider) Overrides the default metadata provider for this cluster.void
setMetadataQuerySupplier
(Supplier<RelMetadataQuery> mqSupplier) Sets up the customizedRelMetadataQuery
instance supplier that to use during rule planning.void
setOriginalExpression
(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 customizedRelMetadataQuery
instance supplier that to use during rule planning.Note that the
mqSupplier
should return a fresh newRelMetadataQuery
instance because the instance would be cached in this cluster, and we may invalidate and re-generate it for eachRelOptRuleCall
cycle. -
getMetadataQuery
Returns the current RelMetadataQuery.This method might be changed or moved in future. If you have a
RelOptRuleCall
available, 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 currentRelMetadataQuery
becomes 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
hintStrategies
would 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()
.