public static class ReduceExpressionsRule.FilterReduceExpressionsRule extends ReduceExpressionsRule
ReduceExpressionsRule.CalcReduceExpressionsRule, ReduceExpressionsRule.CaseShuttle, ReduceExpressionsRule.FilterReduceExpressionsRule, ReduceExpressionsRule.JoinReduceExpressionsRule, ReduceExpressionsRule.ProjectReduceExpressionsRule, ReduceExpressionsRule.ReducibleExprLocator, ReduceExpressionsRule.RexReplacer, ReduceExpressionsRule.WindowReduceExpressionsRule
CALC_INSTANCE, EXCLUSION_PATTERN, FILTER_INSTANCE, JOIN_INSTANCE, matchNullability, PROJECT_INSTANCE, WINDOW_INSTANCE
description, operands, relBuilderFactory
Constructor and Description |
---|
FilterReduceExpressionsRule(java.lang.Class<? extends Filter> filterClass,
boolean matchNullability,
RelBuilderFactory relBuilderFactory) |
FilterReduceExpressionsRule(java.lang.Class<? extends Filter> filterClass,
RelBuilderFactory relBuilderFactory)
Deprecated.
|
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.
|
private void |
reduceNotNullableFilter(RelOptRuleCall call,
Filter filter,
RexNode rexNode,
boolean reverse) |
findReducibleExps, predicateConstants, pushPredicateIntoCase, reduceExpressions, reduceExpressions, reduceExpressions, reduceExpressionsInternal, substitute
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
@Deprecated public FilterReduceExpressionsRule(java.lang.Class<? extends Filter> filterClass, RelBuilderFactory relBuilderFactory)
public FilterReduceExpressionsRule(java.lang.Class<? extends Filter> filterClass, boolean matchNullability, RelBuilderFactory relBuilderFactory)
public void onMatch(RelOptRuleCall call)
RelOptRule
call.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>)
to
register the expression.
onMatch
in class RelOptRule
call
- 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.private void reduceNotNullableFilter(RelOptRuleCall call, Filter filter, RexNode rexNode, boolean reverse)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.