Package org.apache.calcite.rel.rules
Class HyperGraph
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.rules.HyperGraph
- All Implemented Interfaces:
Cloneable,RelOptNode,RelNode
HyperGraph represents a join graph.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context -
Field Summary
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, traitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHyperGraph(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, List<HyperEdge> edges, RelDataType rowType) protectedHyperGraph(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, List<HyperEdge> edges, RelDataType rowType, ImmutableBitSet complexEdgesBitmap, HashMap<Long, BitSet> ccpUsedEdgesMap, HashMap<Long, BitSet> simpleEdgesMap, HashMap<Long, BitSet> complexEdgesMap, HashMap<Long, BitSet> overlapEdgesMap) -
Method Summary
Modifier and TypeMethodDescriptionaccept(RexShuttle shuttle) Accepts a visit from a shuttle.connectCsgCmp(long csg, long cmp) If csg and cmp are connected, return the edges that connect them.voidconvertHyperEdgeCond(RelBuilder builder) Before starting enumeration, add Project on every input, make all field name unique.copy(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.Describes the inputs and attributes of this relational expression.extractJoinCond(RelNode left, RelNode right, List<HyperEdge> edges) @Nullable JoinRelTypeextractJoinType(List<HyperEdge> edges) getEdges()Returns an array of this relational expression's inputs.longgetNeighborBitmap(long csg, long forbidden) voidinitEdgeBitMap(long subset) voidreplaceInput(int ordinalInParent, RelNode p) Replaces theordinalInParentth input.voidupdateEdgesForUnion(long subset1, long subset2) Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Constructor Details
-
HyperGraph
protected HyperGraph(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, List<HyperEdge> edges, RelDataType rowType) -
HyperGraph
protected HyperGraph(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, List<HyperEdge> edges, RelDataType rowType, ImmutableBitSet complexEdgesBitmap, HashMap<Long, BitSet> ccpUsedEdgesMap, HashMap<Long, BitSet> simpleEdgesMap, HashMap<Long, BitSet> complexEdgesMap, HashMap<Long, BitSet> overlapEdgesMap)
-
-
Method Details
-
copy
Description copied from interface:RelNodeCreates a copy of this relational expression, perhaps changing traits and inputs.Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
- Specified by:
copyin interfaceRelNode- Overrides:
copyin classAbstractRelNode- Parameters:
traitSet- Trait setinputs- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
explainTerms
Description copied from class:AbstractRelNodeDescribes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms, then call theRelWriter.input(String, RelNode)andRelWriter.item(String, Object)methods for each input and attribute.- Overrides:
explainTermsin classAbstractRelNode- Parameters:
pw- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
getInputs
Description copied from interface:RelNodeReturns an array of this relational expression's inputs. If there are no inputs, returns an empty list, notnull.- Specified by:
getInputsin interfaceRelNode- Specified by:
getInputsin interfaceRelOptNode- Overrides:
getInputsin classAbstractRelNode- Returns:
- Array of this relational expression's inputs
-
replaceInput
Description copied from interface:RelNodeReplaces theordinalInParentth input. You must override this method if you overrideRelNode.getInputs().- Specified by:
replaceInputin interfaceRelNode- Overrides:
replaceInputin classAbstractRelNode- Parameters:
ordinalInParent- Position of the child input, 0 is the firstp- New node that should be put at positionordinalInParent
-
deriveRowType
- Overrides:
deriveRowTypein classAbstractRelNode
-
accept
Description copied from interface:RelNodeAccepts a visit from a shuttle. If the shuttle updates expression, then a copy of the relation should be created. This new relation might have a different row-type.- Specified by:
acceptin interfaceRelNode- Overrides:
acceptin classAbstractRelNode- Parameters:
shuttle- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
getEdges
-
getNeighborBitmap
public long getNeighborBitmap(long csg, long forbidden) -
connectCsgCmp
If csg and cmp are connected, return the edges that connect them. -
initEdgeBitMap
public void initEdgeBitMap(long subset) -
updateEdgesForUnion
public void updateEdgesForUnion(long subset1, long subset2) -
extractJoinType
-
extractJoinCond
-
convertHyperEdgeCond
Before starting enumeration, add Project on every input, make all field name unique. Convert the HyperEdge condition from RexInputRef to RexInputFieldName
-