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.
LogicalFilter| Modifier and Type | Field and Description |
|---|---|
protected RexNode |
condition |
digest, id, rowType, traitSet| Modifier | Constructor and Description |
|---|---|
protected |
Filter(RelInput input)
Creates a Filter by parsing serialized output.
|
protected |
Filter(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
RexNode condition)
Creates a filter.
|
| Modifier and Type | Method and Description |
|---|---|
RelNode |
accept(RexShuttle shuttle)
Accepts a visit from a shuttle.
|
RelOptCost |
computeSelfCost(RelOptPlanner planner)
Returns the cost of this plan (not including children).
|
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) |
static double |
estimateFilteredRows(RelNode child,
RexNode condition) |
static double |
estimateFilteredRows(RelNode child,
RexProgram program) |
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
List<RexNode> |
getChildExps()
Returns a list of this relational expression's child expressions.
|
RexNode |
getCondition() |
double |
getRows()
Returns an estimate of the number of rows this relational expression will
return.
|
boolean |
isValid(boolean fail)
Returns whether this relational expression is valid.
|
childrenAccept, deriveRowType, getInput, getInputs, replaceInputaccept, collectVariablesSet, collectVariablesUsed, computeDigest, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, metadata, onRegister, recomputeDigest, register, sole, toStringprotected final RexNode condition
protected Filter(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexNode condition)
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 passprotected Filter(RelInput input)
public final RelNode copy(RelTraitSet traitSet, List<RelNode> inputs)
RelNodeSub-classes with other important attributes are encouraged to create variants of this method with more parameters.
copy in interface RelNodecopy in class AbstractRelNodetraitSet - Trait setinputs - Inputspublic abstract Filter copy(RelTraitSet traitSet, RelNode input, RexNode condition)
public List<RexNode> getChildExps()
RelNodeRelNode.getInputs().
The caller should treat the list as unmodifiable; typical
implementations will return an immutable list. If there are no
child expressions, returns an empty list, not null.
getChildExps in interface RelNodegetChildExps in class AbstractRelNodeRelNode.accept(org.apache.calcite.rex.RexShuttle)public RelNode accept(RexShuttle shuttle)
RelNodeaccept in interface RelNodeaccept in class AbstractRelNodeshuttle - Shuttlepublic RexNode getCondition()
public boolean isValid(boolean fail)
RelNodeIf assertions are enabled, this method is typically called with
fail = true, as follows:
This signals that the method can throw anassert rel.isValid(true)
AssertionError if it is
not valid.isValid in interface RelNodeisValid in class AbstractRelNodefail - Whether to fail if invalidpublic RelOptCost computeSelfCost(RelOptPlanner planner)
RelNodeNOTE 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.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNodeplanner - Planner for cost calculationpublic double getRows()
RelNodeNOTE 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.
public static double estimateFilteredRows(RelNode child, RexProgram program)
public RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriterImpl.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writerCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.