Package org.apache.druid.sql.calcite.rel
Class DruidJoinQueryRel
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.druid.sql.calcite.rel.DruidRel<DruidJoinQueryRel>
org.apache.druid.sql.calcite.rel.DruidJoinQueryRel
- All Implemented Interfaces:
Cloneable,org.apache.calcite.plan.RelOptNode,org.apache.calcite.rel.RelNode
DruidRel that uses a
JoinDataSource.-
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 -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this rel with theDruidConventiontrait.buildJoinSourceDesc(SourceDescProducer.SourceDesc leftDesc, SourceDescProducer.SourceDesc rightDesc, PlannerContext plannerContext, org.apache.calcite.rel.core.Join joinRel, org.apache.calcite.rel.core.Filter leftFilter) static Pair<String,RowSignature> computeJoinRowSignature(RowSignature leftSignature, RowSignature rightSignature, Set<String> prefixes) Returns a Pair of "rightPrefix" (for JoinDataSource) and the signature of rows that will result from applying that prefix.static booleancomputeLeftRequiresSubquery(PlannerContext plannerContext, DruidRel<?> left, org.apache.calcite.rel.core.Join joinRel) static booleancomputeRightRequiresSubquery(PlannerContext plannerContext, DruidRel<?> right) org.apache.calcite.plan.RelOptCostcomputeSelfCost(org.apache.calcite.plan.RelOptPlanner planner, org.apache.calcite.rel.metadata.RelMetadataQuery mq) org.apache.calcite.rel.RelNodestatic DruidJoinQueryRelcreate(org.apache.calcite.rel.core.Join joinRel, org.apache.calcite.rel.core.Filter leftFilter, PlannerContext plannerContext) Create an instance from a Join that is based on twoDruidRelinputs.protected org.apache.calcite.rel.type.RelDataTypeorg.apache.calcite.rel.RelWriterexplainTerms(org.apache.calcite.rel.RelWriter pw) Overridden to ensure that subclasses provide a proper implementation.findExistingJoinPrefixes(DataSource... dataSources) Get the set of names of table datasources read by this DruidRelList<org.apache.calcite.rel.RelNode>Returns the PartialDruidQuery associated with this DruidRel, and which can be built on top of.static DruidRel<?>getSomeDruidChild(org.apache.calcite.rel.RelNode child) voidreplaceInput(int ordinalInParent, org.apache.calcite.rel.RelNode p) static JoinTypetoDruidJoinType(org.apache.calcite.rel.core.JoinRelType calciteJoinType) toDruidQuery(boolean finalizeAggregations) Convert this DruidRel to a DruidQuery.Convert this DruidRel to a DruidQuery for purposes of explaining.withPartialQuery(PartialDruidQuery newQueryBuilder) Methods inherited from class org.apache.druid.sql.calcite.rel.DruidRel
clone, getPlannerContext, isValidDruidQuery, runQuery, unwrapLogicalPlanMethods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, equals, estimateRowCount, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, 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
-
Method Details
-
create
public static DruidJoinQueryRel create(org.apache.calcite.rel.core.Join joinRel, org.apache.calcite.rel.core.Filter leftFilter, PlannerContext plannerContext) Create an instance from a Join that is based on twoDruidRelinputs. -
getPartialDruidQuery
Description copied from class:DruidRelReturns 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.- Specified by:
getPartialDruidQueryin classDruidRel<DruidJoinQueryRel>
-
withPartialQuery
- Specified by:
withPartialQueryin classDruidRel<DruidJoinQueryRel>
-
buildJoinSourceDesc
public static SourceDescProducer.SourceDesc buildJoinSourceDesc(SourceDescProducer.SourceDesc leftDesc, SourceDescProducer.SourceDesc rightDesc, PlannerContext plannerContext, org.apache.calcite.rel.core.Join joinRel, org.apache.calcite.rel.core.Filter leftFilter) -
toDruidQuery
Description copied from class:DruidRelConvert 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.- Specified by:
toDruidQueryin classDruidRel<DruidJoinQueryRel>- 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.
-
toDruidQueryForExplaining
Description copied from class:DruidRelConvert this DruidRel to a DruidQuery for purposes of explaining. This must be an inexpensive operation. This method must not return null.- Specified by:
toDruidQueryForExplainingin classDruidRel<DruidJoinQueryRel>
-
asDruidConvention
Description copied from class:DruidRelReturns a copy of this rel with theDruidConventiontrait.- Specified by:
asDruidConventionin classDruidRel<DruidJoinQueryRel>
-
getInputs
- Specified by:
getInputsin interfaceorg.apache.calcite.rel.RelNode- Specified by:
getInputsin interfaceorg.apache.calcite.plan.RelOptNode- Overrides:
getInputsin classorg.apache.calcite.rel.AbstractRelNode
-
replaceInput
public void replaceInput(int ordinalInParent, org.apache.calcite.rel.RelNode p) - Specified by:
replaceInputin interfaceorg.apache.calcite.rel.RelNode- Overrides:
replaceInputin classorg.apache.calcite.rel.AbstractRelNode
-
copy
public org.apache.calcite.rel.RelNode copy(org.apache.calcite.plan.RelTraitSet traitSet, List<org.apache.calcite.rel.RelNode> inputs) - Specified by:
copyin interfaceorg.apache.calcite.rel.RelNode- Overrides:
copyin classorg.apache.calcite.rel.AbstractRelNode
-
getDataSourceNames
Description copied from class:DruidRelGet the set of names of table datasources read by this DruidRel- Specified by:
getDataSourceNamesin classDruidRel<DruidJoinQueryRel>
-
explainTerms
public org.apache.calcite.rel.RelWriter explainTerms(org.apache.calcite.rel.RelWriter pw) Description copied from class:DruidRelOverridden to ensure that subclasses provide a proper implementation. The default implementation fromAbstractRelNodedoes nothing and is not appropriate.- Overrides:
explainTermsin classDruidRel<DruidJoinQueryRel>
-
deriveRowType
protected org.apache.calcite.rel.type.RelDataType deriveRowType()- Overrides:
deriveRowTypein classorg.apache.calcite.rel.AbstractRelNode
-
computeSelfCost
public org.apache.calcite.plan.RelOptCost computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner, org.apache.calcite.rel.metadata.RelMetadataQuery mq) - Specified by:
computeSelfCostin interfaceorg.apache.calcite.rel.RelNode- Overrides:
computeSelfCostin classorg.apache.calcite.rel.AbstractRelNode
-
toDruidJoinType
-
computeLeftRequiresSubquery
public static boolean computeLeftRequiresSubquery(PlannerContext plannerContext, DruidRel<?> left, org.apache.calcite.rel.core.Join joinRel) -
computeRightRequiresSubquery
public static boolean computeRightRequiresSubquery(PlannerContext plannerContext, DruidRel<?> right) -
findExistingJoinPrefixes
-
computeJoinRowSignature
public static Pair<String,RowSignature> computeJoinRowSignature(RowSignature leftSignature, RowSignature rightSignature, Set<String> prefixes) Returns a Pair of "rightPrefix" (for JoinDataSource) and the signature of rows that will result from applying that prefix. -
getSomeDruidChild
-