/** Returns whether to skip a match. This happens if any of the * {@link RelNode}s have importance zero. */ private boolean skipMatch(VolcanoRuleMatch match) { for (RelNode rel : match.rels) { Double importance = planner.relImportances.get(rel); if (importance != null && importance == 0d) { return true; } } // If the same subset appears more than once along any path from root // operand to a leaf operand, we have matched a cycle. A relational // expression that consumes its own output can never be implemented, and // furthermore, if we fire rules on it we may generate lots of garbage. // For example, if // Project(A, X = X + 0) // is in the same subset as A, then we would generate // Project(A, X = X + 0 + 0) // Project(A, X = X + 0 + 0 + 0) // also in the same subset. They are valid but useless. final Deque<RelSubset> subsets = new ArrayDeque<>(); try { checkDuplicateSubsets(subsets, match.rule.getOperand(), match.rels); } catch (Util.FoundOne e) { return true; } return false; }
/** Returns whether to skip a match. This happens if any of the * {@link RelNode}s have importance zero. */ private boolean skipMatch(VolcanoRuleMatch match) { for (RelNode rel : match.rels) { Double importance = planner.relImportances.get(rel); if (importance != null && importance == 0d) { return true; } } // If the same subset appears more than once along any path from root // operand to a leaf operand, we have matched a cycle. A relational // expression that consumes its own output can never be implemented, and // furthermore, if we fire rules on it we may generate lots of garbage. // For example, if // Project(A, X = X + 0) // is in the same subset as A, then we would generate // Project(A, X = X + 0 + 0) // Project(A, X = X + 0 + 0 + 0) // also in the same subset. They are valid but useless. final Deque<RelSubset> subsets = new ArrayDeque<>(); try { checkDuplicateSubsets(subsets, match.rule.getOperand(), match.rels); } catch (Util.FoundOne e) { return true; } return false; }
boolean match = matchOperands( rule.getOperand(), vertex.getCurrentRel(), bindings, new HepRuleCall( this, rule.getOperand(), bindings.toArray(new RelNode[0]), nodeChildren,
boolean match = matchOperands( rule.getOperand(), vertex.getCurrentRel(), bindings, new HepRuleCall( this, rule.getOperand(), bindings.toArray(new RelNode[0]), nodeChildren,
List<RelNode> bindings = new ArrayList<RelNode>(); if (match( rule.getOperand(), rel, bindings)) { new MockRuleCall( this, rule.getOperand(), bindings.toArray(new RelNode[0])); if (rule.matches(call)) {
List<RelNode> bindings = new ArrayList<RelNode>(); if (match( rule.getOperand(), rel, bindings)) { new MockRuleCall( this, rule.getOperand(), bindings.toArray(new RelNode[0])); if (rule.matches(call)) {