Package org.apache.druid.sql.calcite.rel
Class DruidUnnestRel
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.druid.sql.calcite.rel.DruidRel<DruidUnnestRel>
org.apache.druid.sql.calcite.rel.DruidUnnestRel
- All Implemented Interfaces:
Cloneable,org.apache.calcite.plan.RelOptNode,org.apache.calcite.rel.RelNode
Captures an unnest expression for a correlated join. Derived from an
Uncollect.
This rel cannot be executed directly. It is a holder of information for DruidCorrelateUnnestRel.
Unnest on literal values, without correlated join, is handled directly by
DruidUnnestRule. is applied without a correlated join, This covers the case where an unnest has an
input table, this rel resolves the unnest part and delegates the rel to be consumed by other
rule (DruidCorrelateUnnestRule-
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 TypeMethodDescriptionorg.apache.calcite.rel.RelNodeaccept(org.apache.calcite.rex.RexShuttle shuttle) Returns a copy of this rel with theDruidConventiontrait.static DruidUnnestRelcreate(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, org.apache.calcite.rex.RexNode unnestRexNode, PlannerContext plannerContext) 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.Get the set of names of table datasources read by this DruidRelorg.apache.calcite.rex.RexNodeExpression to be unnested.Returns the PartialDruidQuery associated with this DruidRel, and which can be built on top of.org.apache.calcite.rel.core.FiltertoDruidQuery(boolean finalizeAggregations) Convert this DruidRel to a DruidQuery.Convert this DruidRel to a DruidQuery for purposes of explaining.withFilter(org.apache.calcite.rel.core.Filter f) withPartialQuery(PartialDruidQuery newQueryBuilder) withUnnestRexNode(org.apache.calcite.rex.RexNode newInputRexNode) Returns a new rel with a new input.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, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, deepEquals, deepHashCode, 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
-
Method Details
-
getUnnestFilter
public org.apache.calcite.rel.core.Filter getUnnestFilter() -
create
public static DruidUnnestRel create(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, org.apache.calcite.rex.RexNode unnestRexNode, PlannerContext plannerContext) -
accept
public org.apache.calcite.rel.RelNode accept(org.apache.calcite.rex.RexShuttle shuttle) - Specified by:
acceptin interfaceorg.apache.calcite.rel.RelNode- Overrides:
acceptin classorg.apache.calcite.rel.AbstractRelNode
-
getInputRexNode
public org.apache.calcite.rex.RexNode getInputRexNode()Expression to be unnested. -
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<DruidUnnestRel>
-
withPartialQuery
- Specified by:
withPartialQueryin classDruidRel<DruidUnnestRel>
-
withFilter
-
withUnnestRexNode
Returns a new rel with a new input. The output type is unchanged. -
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<DruidUnnestRel>- 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<DruidUnnestRel>
-
asDruidConvention
Description copied from class:DruidRelReturns a copy of this rel with theDruidConventiontrait.- Specified by:
asDruidConventionin classDruidRel<DruidUnnestRel>
-
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<DruidUnnestRel>
-
getDataSourceNames
Description copied from class:DruidRelGet the set of names of table datasources read by this DruidRel- Specified by:
getDataSourceNamesin classDruidRel<DruidUnnestRel>
-
deriveRowType
protected org.apache.calcite.rel.type.RelDataType deriveRowType()- Overrides:
deriveRowTypein classorg.apache.calcite.rel.AbstractRelNode
-