Package org.apache.druid.sql.calcite.rel
Class DruidRel<T extends DruidRel<?>>
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.druid.sql.calcite.rel.DruidRel<T>
- All Implemented Interfaces:
Cloneable,org.apache.calcite.plan.RelOptNode,org.apache.calcite.rel.RelNode
- Direct Known Subclasses:
DruidCorrelateUnnestRel,DruidJoinQueryRel,DruidOuterQueryRel,DruidQueryRel,DruidUnionDataSourceRel,DruidUnionRel,DruidUnnestRel
public abstract class DruidRel<T extends DruidRel<?>>
extends org.apache.calcite.rel.AbstractRelNode
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
org.apache.calcite.rel.RelNode.Context -
Field Summary
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDruidRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traitSet, PlannerContext plannerContext) -
Method Summary
Modifier and TypeMethodDescriptionabstract TReturns a copy of this rel with theDruidConventiontrait.protected Objectclone()org.apache.calcite.rel.RelWriterexplainTerms(org.apache.calcite.rel.RelWriter pw) Overridden to ensure that subclasses provide a proper implementation.Get the set of names of table datasources read by this DruidRelabstract PartialDruidQueryReturns the PartialDruidQuery associated with this DruidRel, and which can be built on top of.booleanrunQuery()abstract DruidQuerytoDruidQuery(boolean finalizeAggregations) Convert this DruidRel to a DruidQuery.abstract DruidQueryConvert this DruidRel to a DruidQuery for purposes of explaining.final org.apache.calcite.rel.RelNodeabstract TwithPartialQuery(PartialDruidQuery newQueryBuilder) Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, deepEquals, deepHashCode, deriveRowType, equals, estimateRowCount, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Constructor Details
-
DruidRel
protected DruidRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traitSet, PlannerContext plannerContext)
-
-
Method Details
-
getPartialDruidQuery
Returns the PartialDruidQuery associated with this DruidRel, and which can be built on top of. Returns null if this rel cannot be built on top of. -
runQuery
-
withPartialQuery
-
isValidDruidQuery
public boolean isValidDruidQuery() -
toDruidQuery
Convert this DruidRel to a DruidQuery. This must be an inexpensive operation, since it is done often throughout query planning. This method must not return null.- Parameters:
finalizeAggregations- true if this query should include explicit finalization for all of its aggregators, where required. Useful for subqueries where Druid's native query layer does not do this automatically.- Throws:
CannotBuildQueryException
-
toDruidQueryForExplaining
Convert this DruidRel to a DruidQuery for purposes of explaining. This must be an inexpensive operation. This method must not return null.- Throws:
CannotBuildQueryException
-
getPlannerContext
-
explainTerms
public org.apache.calcite.rel.RelWriter explainTerms(org.apache.calcite.rel.RelWriter pw) Overridden to ensure that subclasses provide a proper implementation. The default implementation fromAbstractRelNodedoes nothing and is not appropriate.- Overrides:
explainTermsin classorg.apache.calcite.rel.AbstractRelNode
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
asDruidConvention
Returns a copy of this rel with theDruidConventiontrait. -
getDataSourceNames
Get the set of names of table datasources read by this DruidRel -
unwrapLogicalPlan
public final org.apache.calcite.rel.RelNode unwrapLogicalPlan()
-