protected abstract static class SubstitutionVisitor.UnifyRule extends Object
The rule declares the query and target types; this allows the engine to fire only a few rules in a given context.
Modifier and Type | Field and Description |
---|---|
protected SubstitutionVisitor.Operand |
queryOperand |
protected int |
slotCount |
protected SubstitutionVisitor.Operand |
targetOperand |
Modifier | Constructor and Description |
---|---|
protected |
UnifyRule(int slotCount,
SubstitutionVisitor.Operand queryOperand,
SubstitutionVisitor.Operand targetOperand) |
Modifier and Type | Method and Description |
---|---|
protected abstract SubstitutionVisitor.UnifyResult |
apply(SubstitutionVisitor.UnifyRuleCall call)
Applies this rule to a particular node in a query.
|
protected <E> com.google.common.collect.ImmutableList<E> |
copy(E[] slots,
int slotCount) |
protected SubstitutionVisitor.UnifyRuleCall |
match(SubstitutionVisitor visitor,
SubstitutionVisitor.MutableRel query,
SubstitutionVisitor.MutableRel target) |
protected final int slotCount
protected final SubstitutionVisitor.Operand queryOperand
protected final SubstitutionVisitor.Operand targetOperand
protected UnifyRule(int slotCount, SubstitutionVisitor.Operand queryOperand, SubstitutionVisitor.Operand targetOperand)
protected abstract SubstitutionVisitor.UnifyResult apply(SubstitutionVisitor.UnifyRuleCall call)
Applies this rule to a particular node in a query. The goal is
to convert query
into target
. Before the rule is
invoked, Calcite has made sure that query's children are equivalent
to target's children.
There are 3 possible outcomes:
query
already exactly matches target
; returns
target
query
is sufficiently close to a match for
target
; returns target
query
cannot be made to match target
; returns
nullREVIEW: Is possible that we match query PLUS one or more of its ancestors?
call
- Input parametersprotected SubstitutionVisitor.UnifyRuleCall match(SubstitutionVisitor visitor, SubstitutionVisitor.MutableRel query, SubstitutionVisitor.MutableRel target)
protected <E> com.google.common.collect.ImmutableList<E> copy(E[] slots, int slotCount)
Copyright © 2021 The Apache Software Foundation. All rights reserved.