Class Filter
- All Implemented Interfaces:
Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
Bindables.BindableFilter
,CassandraFilter
,ElasticsearchFilter
,EnumerableFilter
,GeodeFilter
,JdbcRules.JdbcFilter
,LogicalFilter
,MongoFilter
,PigFilter
public abstract class Filter extends SingleRel
condition
evaluates to
true
.
If the condition allows nulls, then a null value is treated the same as false.
- See Also:
LogicalFilter
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
Filter(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexNode condition)
Creates a filter.protected
Filter(RelInput input)
Creates a Filter by parsing serialized output. -
Method Summary
Modifier and Type Method Description RelNode
accept(RexShuttle shuttle)
Accepts a visit from a shuttle.RelOptCost
computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Returns the cost of this plan (not including children).boolean
containsOver()
Returns whether this Filter contains any windowed-aggregate functions.RelNode
copy(RelTraitSet traitSet, List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and inputs.abstract Filter
copy(RelTraitSet traitSet, RelNode input, RexNode condition)
protected boolean
deepEquals0(Object obj)
protected int
deepHashCode0()
static double
estimateFilteredRows(RelNode child, RexNode condition)
Deprecated.static double
estimateFilteredRows(RelNode child, RexProgram program)
Deprecated.double
estimateRowCount(RelMetadataQuery mq)
Returns an estimate of the number of rows this relational expression will return.RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.RexNode
getCondition()
boolean
isValid(Litmus litmus, RelNode.Context context)
Returns whether this relational expression is valid.Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, getInput, getInputs, replaceInput
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, metadata, onRegister, recomputeDigest, register, sole, toString
-
Field Details
-
Constructor Details
-
Filter
Creates a filter.- Parameters:
cluster
- Cluster that this relational expression belongs totraits
- the traits of this relchild
- input relational expressioncondition
- boolean expression which determines whether a row is allowed to pass
-
Filter
Creates a Filter by parsing serialized output.
-
-
Method Details
-
copy
Description copied from interface:RelNode
Creates 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:
copy
in interfaceRelNode
- Overrides:
copy
in classAbstractRelNode
- Parameters:
traitSet
- Trait setinputs
- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
copy
-
accept
Description copied from interface:RelNode
Accepts 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:
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
-
getCondition
-
containsOver
public final boolean containsOver()Returns whether this Filter contains any windowed-aggregate functions. -
isValid
Description copied from interface:RelNode
Returns whether this relational expression is valid.If assertions are enabled, this method is typically called with
litmus
=THROW
, as follows:assert rel.isValid(Litmus.THROW)
This signals that the method can throw an
AssertionError
if it is not valid.- Specified by:
isValid
in interfaceRelNode
- Overrides:
isValid
in classAbstractRelNode
- Parameters:
litmus
- What to do if invalidcontext
- Context for validity checking- Returns:
- Whether relational expression is valid
-
computeSelfCost
Description copied from interface:RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about cost.- Specified by:
computeSelfCost
in interfaceRelNode
- Overrides:
computeSelfCost
in classAbstractRelNode
- Parameters:
planner
- Planner for cost calculationmq
- Metadata query- Returns:
- Cost of this plan (not including children)
-
estimateRowCount
Description copied from interface:RelNode
Returns an estimate of the number of rows this relational expression will return.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about row count.- Specified by:
estimateRowCount
in interfaceRelNode
- Overrides:
estimateRowCount
in classSingleRel
- Parameters:
mq
- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
estimateFilteredRows
Deprecated. -
estimateFilteredRows
Deprecated. -
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)
andRelWriterImpl.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classSingleRel
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
deepEquals0
-
deepHashCode0
@API(since="1.24", status=INTERNAL) protected int deepHashCode0()
-