本文整理汇总了Java中org.apache.calcite.plan.RelOptRuleOperand类的典型用法代码示例。如果您正苦于以下问题:Java RelOptRuleOperand类的具体用法?Java RelOptRuleOperand怎么用?Java RelOptRuleOperand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RelOptRuleOperand类属于org.apache.calcite.plan包,在下文中一共展示了RelOptRuleOperand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireRules
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Fires all rules matched by a relational expression.
*
* @param rel Relational expression which has just been created (or maybe
* from the queue)
* @param deferred If true, each time a rule matches, just add an entry to
* the queue.
*/
void fireRules(
RelNode rel,
boolean deferred) {
for (RelOptRuleOperand operand : classOperands.get(rel.getClass())) {
if (operand.matches(rel)) {
final VolcanoRuleCall ruleCall;
if (deferred) {
ruleCall = new DeferringRuleCall(this, operand);
} else {
ruleCall = new VolcanoRuleCall(this, operand);
}
ruleCall.match(rel);
}
}
}
示例2: match
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Matches a relational expression to a rule.
*
* @param operand Root operand of rule
* @param rel Relational expression
* @param bindings Bindings, populated on successful match
* @return whether relational expression matched rule
*/
private boolean match(
RelOptRuleOperand operand,
RelNode rel,
List<RelNode> bindings) {
if (!operand.matches(rel)) {
return false;
}
bindings.add(rel);
switch (operand.childPolicy) {
case ANY:
return true;
}
List<RelOptRuleOperand> childOperands = operand.getChildOperands();
List<? extends RelNode> childRels = rel.getInputs();
if (childOperands.size() != childRels.size()) {
return false;
}
for (Pair<RelOptRuleOperand, ? extends RelNode> pair
: Pair.zip(childOperands, childRels)) {
if (!match(pair.left, pair.right, bindings)) {
return false;
}
}
return true;
}
示例3: FilterJoinRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Creates a FilterProjectTransposeRule with an explicit root operand and
* factories.
*/
protected FilterJoinRule(RelOptRuleOperand operand, String id, boolean smart, RelBuilderFactory relBuilderFactory,
Predicate predicate) {
super(operand, relBuilderFactory, "FilterJoinRule:" + id);
this.smart = smart;
this.predicate = Preconditions.checkNotNull(predicate);
}
示例4: JoinProjectTransposeRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/** Creates a JoinProjectTransposeRule. */
public JoinProjectTransposeRule(RelOptRuleOperand operand,
String description, boolean includeOuter,
RelBuilderFactory relBuilderFactory) {
super(operand, relBuilderFactory, description);
this.includeOuter = includeOuter;
}
示例5: AbstractMaterializedViewRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/** Creates a AbstractMaterializedViewRule. */
protected AbstractMaterializedViewRule(RelOptRuleOperand operand,
RelBuilderFactory relBuilderFactory, String description,
boolean generateUnionRewriting) {
super(operand, relBuilderFactory, description);
this.generateUnionRewriting = generateUnionRewriting;
}
示例6: FilterProjectTransposeRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
protected FilterProjectTransposeRule(
RelOptRuleOperand operand,
boolean copyFilter,
boolean copyProject,
RelBuilderFactory relBuilderFactory) {
super(operand, relBuilderFactory, null);
this.copyFilter = copyFilter;
this.copyProject = copyProject;
}
示例7: MultiJoinProjectTransposeRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/** Creates a MultiJoinProjectTransposeRule. */
public MultiJoinProjectTransposeRule(
RelOptRuleOperand operand,
RelBuilderFactory relBuilderFactory,
String description) {
super(operand, description, false, relBuilderFactory);
}
示例8: FilterJoinRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Creates a FilterProjectTransposeRule with an explicit root operand and
* factories.
*/
protected FilterJoinRule(RelOptRuleOperand operand, String id,
boolean smart, RelBuilderFactory relBuilderFactory, Predicate predicate) {
super(operand, relBuilderFactory, "FilterJoinRule:" + id);
this.smart = smart;
this.predicate = Preconditions.checkNotNull(predicate);
}
示例9: removeRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
public boolean removeRule(RelOptRule rule) {
if (!ruleSet.remove(rule)) {
// Rule was not present.
return false;
}
// Remove description.
unmapRuleDescription(rule);
// Remove operands.
for (Iterator<RelOptRuleOperand> iter = classOperands.values().iterator();
iter.hasNext();) {
RelOptRuleOperand entry = iter.next();
if (entry.getRule().equals(rule)) {
iter.remove();
}
}
// Remove trait mappings. (In particular, entries from conversion
// graph.)
if (rule instanceof ConverterRule) {
ConverterRule converterRule = (ConverterRule) rule;
final RelTrait ruleTrait = converterRule.getInTrait();
final RelTraitDef ruleTraitDef = ruleTrait.getTraitDef();
if (traitDefs.contains(ruleTraitDef)) {
ruleTraitDef.deregisterConverterRule(this, converterRule);
}
}
return true;
}
示例10: onNewClass
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
@Override protected void onNewClass(RelNode node) {
super.onNewClass(node);
// Create mappings so that instances of this class will match existing
// operands.
final Class<? extends RelNode> clazz = node.getClass();
for (RelOptRule rule : ruleSet) {
for (RelOptRuleOperand operand : rule.getOperands()) {
if (operand.getMatchedClass().isAssignableFrom(clazz)) {
classOperands.put(clazz, operand);
}
}
}
}
示例11: VolcanoRuleCall
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Creates a rule call.
*
* @param planner Planner
* @param operand First operand of the rule
*/
VolcanoRuleCall(
VolcanoPlanner planner,
RelOptRuleOperand operand) {
this(
planner,
operand,
new RelNode[operand.getRule().operands.size()],
ImmutableMap.<RelNode, List<RelNode>>of());
}
示例12: VolcanoRuleMatch
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Creates a <code>VolcanoRuleMatch</code>.
*
* @param operand0 Primary operand
* @param rels List of targets; copied by the constructor, so the client
* can modify it later
* @param nodeInputs Map from relational expressions to their inputs
*/
VolcanoRuleMatch(VolcanoPlanner volcanoPlanner, RelOptRuleOperand operand0,
RelNode[] rels, Map<RelNode, List<RelNode>> nodeInputs) {
super(volcanoPlanner, operand0, rels.clone(), nodeInputs);
assert allNotNull(rels, Litmus.THROW);
// Try to deduce which subset the result will belong to. Assume --
// for now -- that the set is the same as the root relexp.
targetSet = volcanoPlanner.getSet(rels[0]);
assert targetSet != null : rels[0].toString() + " isn't in a set";
digest = computeDigest();
}
示例13: HepRuleCall
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
HepRuleCall(
RelOptPlanner planner,
RelOptRuleOperand operand,
RelNode[] rels,
Map<RelNode, List<RelNode>> nodeChildren,
List<RelNode> parents) {
super(planner, operand, rels, nodeChildren, parents);
results = new ArrayList<RelNode>();
}
示例14: MockRuleCall
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
/**
* Creates a MockRuleCall.
*
* @param planner Planner
* @param operand Operand
* @param rels List of matched relational expressions
*/
MockRuleCall(
RelOptPlanner planner,
RelOptRuleOperand operand,
RelNode[] rels) {
super(
planner,
operand,
rels,
Collections.<RelNode, List<RelNode>>emptyMap());
}
示例15: PruneScanRule
import org.apache.calcite.plan.RelOptRuleOperand; //导入依赖的package包/类
public PruneScanRule(RelOptRuleOperand operand, String id, OptimizerRulesContext optimizerContext) {
super(operand, id);
this.optimizerContext = optimizerContext;
}