Class LogicalFilter
- All Implemented Interfaces:
Cloneable
,RelOptNode
,Hintable
,RelNode
Filter
not targeted at any particular engine or calling convention.-
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, rowType, traitSet
-
Constructor Summary
ConstructorDescriptionLogicalFilter
(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode child, RexNode condition, com.google.common.collect.ImmutableSet<CorrelationId> variablesSet) Creates a LogicalFilter.LogicalFilter
(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode condition) Deprecated.LogicalFilter
(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode condition, com.google.common.collect.ImmutableSet<CorrelationId> variablesSet) Creates a LogicalFilter.LogicalFilter
(RelOptCluster cluster, RelNode child, RexNode condition) Deprecated.LogicalFilter
(RelInput input) Creates a LogicalFilter by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(RelShuttle shuttle) Accepts a visit from a shuttle.copy
(RelTraitSet traitSet, RelNode input, RexNode condition) static LogicalFilter
Creates a LogicalFilter.static LogicalFilter
create
(RelNode input, RexNode condition, com.google.common.collect.ImmutableSet<CorrelationId> variablesSet) Creates a LogicalFilter.boolean
deepEquals
(@Nullable Object obj) Equality check for RelNode digest.int
Compute hash code for RelNode digest.Describes the inputs and attributes of this relational expression.Returns the variables that are set in this relational expression but also used and therefore not available to parents of this relational expression.Returns a new relational expression with the specified hintshintList
.Methods inherited from class org.apache.calcite.rel.core.Filter
accept, computeSelfCost, containsOver, copy, deepEquals0, deepHashCode0, estimateFilteredRows, estimateFilteredRows, estimateRowCount, getCondition, getHints, isValid
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, getInput, getInputs, replaceInput
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
collectVariablesSet, collectVariablesUsed, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, hashCode, isEnforcer, metadata, onRegister, recomputeDigest, register, sole, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Constructor Details
-
LogicalFilter
public LogicalFilter(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode child, RexNode condition, com.google.common.collect.ImmutableSet<CorrelationId> variablesSet) Creates a LogicalFilter.Use
create(org.apache.calcite.rel.RelNode, org.apache.calcite.rex.RexNode)
unless you know what you're doing.- Parameters:
cluster
- Cluster that this relational expression belongs tochild
- Input relational expressioncondition
- Boolean expression which determines whether a row is allowed to passvariablesSet
- Correlation variables set by this relational expression to be used by nested expressions
-
LogicalFilter
public LogicalFilter(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode condition, com.google.common.collect.ImmutableSet<CorrelationId> variablesSet) Creates a LogicalFilter.Use
create(org.apache.calcite.rel.RelNode, org.apache.calcite.rex.RexNode)
unless you know what you're doing.- Parameters:
cluster
- Cluster that this relational expression belongs tochild
- Input relational expressioncondition
- Boolean expression which determines whether a row is allowed to passvariablesSet
- Correlation variables set by this relational expression to be used by nested expressions
-
LogicalFilter
@Deprecated public LogicalFilter(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode condition) Deprecated. -
LogicalFilter
Deprecated. -
LogicalFilter
Creates a LogicalFilter by parsing serialized output.
-
-
Method Details
-
create
Creates a LogicalFilter. -
create
public static LogicalFilter create(RelNode input, RexNode condition, com.google.common.collect.ImmutableSet<CorrelationId> variablesSet) Creates a LogicalFilter. -
getVariablesSet
Description copied from interface:RelNode
Returns the variables that are set in this relational expression but also used and therefore not available to parents of this relational expression.- Specified by:
getVariablesSet
in interfaceRelNode
- Overrides:
getVariablesSet
in classAbstractRelNode
- Returns:
- Names of variables which are set in this relational expression
-
copy
-
accept
Description copied from interface:RelNode
Accepts a visit from a shuttle.- Specified by:
accept
in interfaceRelNode
- Overrides:
accept
in classAbstractRelNode
- Parameters:
shuttle
- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
explainTerms
Description copied from class:AbstractRelNode
Describes 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:
explainTerms
in classFilter
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
deepEquals
Description copied from class:AbstractRelNode
Equality check for RelNode digest.By default this method collects digest attributes from
AbstractRelNode.explainTerms(RelWriter)
, then compares each attribute pair. This should work well for most cases. If this method is a performance bottleneck for your project, or the default behavior can't handle your scenario properly, you can choose to override this method andAbstractRelNode.deepHashCode()
. SeeLogicalJoin
as an example.- Specified by:
deepEquals
in interfaceRelNode
- Overrides:
deepEquals
in classAbstractRelNode
- Returns:
- Whether the 2 RelNodes are equivalent or have the same digest.
- See Also:
-
deepHashCode
public int deepHashCode()Description copied from class:AbstractRelNode
Compute hash code for RelNode digest.- Specified by:
deepHashCode
in interfaceRelNode
- Overrides:
deepHashCode
in classAbstractRelNode
- See Also:
-
withHints
Description copied from interface:Hintable
Returns a new relational expression with the specified hintshintList
.This method should be overridden by every logical node that supports hint. It is only for internal use during decorrelation.
Sub-class should return a new copy of the relational expression.
The default implementation returns the relational expression directly only because not every kind of relational expression supports hints.
- Returns:
- Relational expression with set up hints
-