public static class ReduceExpressionsRule.FilterReduceExpressionsRule extends ReduceExpressionsRule<ReduceExpressionsRule.FilterReduceExpressionsRule.FilterReduceExpressionsRuleConfig>
Filter.
If the condition is a constant, the filter is removed (if TRUE) or replaced with
an empty Values (if FALSE or NULL).CoreRules.FILTER_REDUCE_EXPRESSIONS| Modifier and Type | Class and Description |
|---|---|
static interface |
ReduceExpressionsRule.FilterReduceExpressionsRule.FilterReduceExpressionsRuleConfig
Rule configuration.
|
ReduceExpressionsRule.CalcReduceExpressionsRule, ReduceExpressionsRule.CaseShuttle, ReduceExpressionsRule.Config, ReduceExpressionsRule.FilterReduceExpressionsRule, ReduceExpressionsRule.JoinReduceExpressionsRule, ReduceExpressionsRule.ProjectReduceExpressionsRule, ReduceExpressionsRule.ReducibleExprLocator, ReduceExpressionsRule.RexReplacer, ReduceExpressionsRule.WindowReduceExpressionsRuleRelRule.Done, RelRule.MatchHandler<R extends RelOptRule>, RelRule.OperandBuilder, RelRule.OperandDetailBuilder<R extends RelNode>, RelRule.OperandTransformRelOptRule.ConverterRelOptRuleOperandEXCLUSION_PATTERNdescription, operands, relBuilderFactory| Modifier | Constructor and Description |
|---|---|
|
FilterReduceExpressionsRule(Class<? extends Filter> filterClass,
boolean matchNullability,
RelBuilderFactory relBuilderFactory)
Deprecated.
|
|
FilterReduceExpressionsRule(Class<? extends Filter> filterClass,
RelBuilderFactory relBuilderFactory)
Deprecated.
|
protected |
FilterReduceExpressionsRule(ReduceExpressionsRule.FilterReduceExpressionsRule.FilterReduceExpressionsRuleConfig config)
Creates a FilterReduceExpressionsRule.
|
| Modifier and Type | Method and Description |
|---|---|
protected RelNode |
createEmptyRelOrEquivalent(RelOptRuleCall call,
Filter input)
For static schema systems, a filter that is always false or null can be
replaced by a values operator that produces no rows, as the schema
information can just be taken from the input Rel.
|
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match.
|
findReducibleExps, predicateConstants, pushPredicateIntoCase, reduceExpressions, reduceExpressions, reduceExpressions, reduceExpressionsInternal, substituteany, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unorderedclone, finalize, getClass, notify, notifyAll, wait, wait, waitautoPruneOldprotected FilterReduceExpressionsRule(ReduceExpressionsRule.FilterReduceExpressionsRule.FilterReduceExpressionsRuleConfig config)
@Deprecated public FilterReduceExpressionsRule(Class<? extends Filter> filterClass, RelBuilderFactory relBuilderFactory)
@Deprecated public FilterReduceExpressionsRule(Class<? extends Filter> filterClass, boolean matchNullability, RelBuilderFactory relBuilderFactory)
public void onMatch(RelOptRuleCall call)
RelOptRulecall.rels holds the set of relational
expressions which match the operands to the rule;
call.rels[0] is the root expression.
Typically a rule would check that the nodes are valid matches, creates
a new expression, then calls back RelOptRuleCall.transformTo(org.apache.calcite.rel.RelNode, java.util.Map<org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelHintsPropagator) to
register the expression.
onMatch in class RelOptRulecall - Rule callRelOptRule.matches(RelOptRuleCall)protected RelNode createEmptyRelOrEquivalent(RelOptRuleCall call, Filter input)
The default implementation of this method is to call
RelBuilder.empty(), which for the static schema will be optimized
to an empty
Values.
input - rel to replace, assumes caller has already determined
equivalence to Values operation for 0 records or a
false filter.Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.