public abstract class BeamJoinRel extends org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.Join implements BeamRelNode
BeamRelNode
to implement Join Rels.
Support for join can be categorized into 4 cases:
Modifier and Type | Class and Description |
---|---|
protected class |
BeamJoinRel.ExtractJoinKeys |
condition, joinInfo, joinType, variablesSet
Modifier | Constructor and Description |
---|---|
protected |
BeamJoinRel(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.plan.RelOptCluster cluster,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.plan.RelTraitSet traits,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode left,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode right,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode condition,
java.util.Set<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.CorrelationId> variablesSet,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.JoinRelType joinType) |
Modifier and Type | Method and Description |
---|---|
BeamCostModel |
beamComputeSelfCost(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.plan.RelOptPlanner planner,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.metadata.RelMetadataQuery mq)
This method is called by
org.apache.beam.sdk.extensions.sql.impl.CalciteQueryPlanner.NonCumulativeCostImpl . |
protected Schema |
buildNullSchema(Schema schema) |
static boolean |
containsSeekableInput(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode relNode)
This method returns whether any of the children of the relNode are Seekable.
|
NodeStats |
estimateNodeStats(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.metadata.RelMetadataQuery mq)
This method is called by
org.apache.beam.sdk.extensions.sql.impl.planner.RelMdNodeStats . |
static PCollection.IsBounded |
getBoundednessOfRelNode(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode relNode)
This method returns the Boundedness of a RelNode.
|
java.util.List<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode> |
getPCollectionInputs() |
static boolean |
isJoinLegal(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.Join join)
This method checks if a join is legal and can be converted into Beam SQL.
|
protected boolean |
isSideInputLookupJoin() |
protected org.apache.beam.vendor.calcite.v1_20_0.com.google.common.base.Optional<java.lang.Integer> |
nonSeekableInputIndex() |
static boolean |
seekable(BeamRelNode relNode)
check if
BeamRelNode implements BeamSeekableTable . |
protected org.apache.beam.vendor.calcite.v1_20_0.com.google.common.base.Optional<java.lang.Integer> |
seekableInputIndex() |
protected static <K,V> PCollection<KV<K,V>> |
setValueCoder(PCollection<KV<K,V>> kvs,
Coder<V> valueCoder) |
accept, analyzeCondition, computeSelfCost, copy, copy, createJoinType, deriveJoinRowType, deriveRowType, estimateJoinedRows, estimateRowCount, explainTerms, getChildExps, getCondition, getJoinType, getSystemFieldList, getVariablesSet, isSemiJoin, isSemiJoinDone, isValid
childrenAccept, getInputs, getLeft, getRight, replaceInput
accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
buildPTransform, getPipelineOptions, isBounded
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput
protected BeamJoinRel(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.plan.RelOptCluster cluster, org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.plan.RelTraitSet traits, org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode left, org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode right, org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode condition, java.util.Set<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.CorrelationId> variablesSet, org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.JoinRelType joinType)
public java.util.List<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode> getPCollectionInputs()
getPCollectionInputs
in interface BeamRelNode
protected boolean isSideInputLookupJoin()
protected org.apache.beam.vendor.calcite.v1_20_0.com.google.common.base.Optional<java.lang.Integer> seekableInputIndex()
protected org.apache.beam.vendor.calcite.v1_20_0.com.google.common.base.Optional<java.lang.Integer> nonSeekableInputIndex()
public static boolean seekable(BeamRelNode relNode)
BeamRelNode
implements BeamSeekableTable
.public BeamCostModel beamComputeSelfCost(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.plan.RelOptPlanner planner, org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.metadata.RelMetadataQuery mq)
BeamRelNode
org.apache.beam.sdk.extensions.sql.impl.CalciteQueryPlanner.NonCumulativeCostImpl
. This is
currently only used in SQLTransform Path (and not JDBC path). This is needed when Calcite Query
Planner wants to get the cost of a plan. Instead of calling this directly for a node, if we
needed that it should be obtained by calling mq.getNonCumulativeCost. This way RelMetadataQuery
will call this method instead of ComputeSelfCost if the handler is set correctly (see org.apache.beam.sdk.extensions.sql.impl.CalciteQueryPlanner#convertToBeamRel(String)
)beamComputeSelfCost
in interface BeamRelNode
public NodeStats estimateNodeStats(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.metadata.RelMetadataQuery mq)
BeamRelNode
org.apache.beam.sdk.extensions.sql.impl.planner.RelMdNodeStats
. This is currently only used in
SQLTransform Path (and not JDBC path). When a RelNode wants to calculate its BeamCost or
estimate its NodeStats, it may need NodeStat of its inputs. However, it should not call this
directly (because maybe its inputs are not physical yet). It should call BeamSqlRelUtils.getNodeStats(
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode,
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.metadata.RelMetadataQuery)
instead.estimateNodeStats
in interface BeamRelNode
public static boolean isJoinLegal(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.core.Join join)
BeamJoinAssociateRule
and BeamJoinPushThroughJoinRule
protected static <K,V> PCollection<KV<K,V>> setValueCoder(PCollection<KV<K,V>> kvs, Coder<V> valueCoder)
public static PCollection.IsBounded getBoundednessOfRelNode(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode relNode)
BeamCoGBKJoinRule
and BeamSideInputJoinRule
The Volcano planner works in a top-down fashion. It starts by transforming the root and move towards the leafs of the plan. Due to this when transforming a logical join its inputs are still in the logical convention. So, Recursively visit the inputs of the RelNode till BeamIOSourceRel is encountered and propagate the boundedness upwards.
The Boundedness of each child of a RelNode is stored in a list. If any of the children are Unbounded, the RelNode is Unbounded. Else, the RelNode is Bounded.
relNode
- the RelNode whose Boundedness has to be determinedPCollection.isBounded
public static boolean containsSeekableInput(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.RelNode relNode)
BeamCoGBKJoinRule
and BeamSideInputJoinRule
and BeamSideInputLookupJoinRule
relNode
- the relNode whose children can be Seekable