public void visit( RelNode node, int ordinal, RelNode parent) { if (node instanceof JdbcHiveTableScan && tmpJdbcHiveTableScan [0] == null) { tmpJdbcHiveTableScan [0] = (JdbcHiveTableScan) node; } else { super.visit(node, ordinal, parent); } } }.go(this);
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan || node instanceof Filter || node instanceof Project || node instanceof Join) { // We can continue super.visit(node, ordinal, parent); } else if (node instanceof Aggregate && containsAggregate) { // We can continue super.visit(node, ordinal, parent); } else { throw new ReturnedValue(false); } } }.go(union.getInput(0));
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof Project || node instanceof Filter || node instanceof TableScan) { // We can continue super.visit(node, ordinal, parent); } else { throw new ReturnedValue(false); } }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan) { TableScan ts = (TableScan) node; tablesUsed.add(((RelOptHiveTable) ts.getTable()).getHiveTableMD().getFullyQualifiedName()); } super.visit(node, ordinal, parent); } }.go(plan);
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof HepRelVertex) { node = ((HepRelVertex) node).getCurrentRel(); } if (node instanceof TableScan) { simpleTree = true; } else if (node instanceof Project) { simpleTree = isSimple((Project) node); } else if (node instanceof Filter) { simpleTree = isSimple((Filter) node, mq); } else { simpleTree = false; } if (simpleTree) { super.visit(node, ordinal, parent); } }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof Aggregate) { this.containsAggregate = true; // Aggregate mode - it should be followed by union // that we need to analyze RelNode input = node.getInput(0); if (input instanceof Union) { check((Union) input); } } else if (node instanceof Union) { // Non aggregate mode - analyze union operator check((Union) node); } else if (node instanceof Project) { // Project operator, we can continue super.visit(node, ordinal, parent); } throw new ReturnedValue(false); }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof HepRelVertex) { node = ((HepRelVertex) node).getCurrentRel(); } if (node instanceof TableScan) { simpleTree = true; } else if (node instanceof Project) { simpleTree = isSimple((Project) node); nonFilteringTree &= simpleTree; } else if (node instanceof Filter) { // Remove is not null from condition if it does not filter anything. Filter filterOp = (Filter) node; List<RexNode> conjs = extractFilterPreds(filterOp); ImmutableBitSet condBits = RelOptUtil.InputFinder.bits(conjs, null); // For simple tree, we want to know whether filter is only on // key columns. simpleTree = isSimple(condBits, filterOp, mq); nonFilteringTree &= conjs.isEmpty(); } else { simpleTree = false; nonFilteringTree = false; } if (simpleTree) { super.visit(node, ordinal, parent); } }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan) { // We can continue // TODO: Need to check that this is the same MV that we are rebuilding RelOptHiveTable hiveTable = (RelOptHiveTable) node.getTable(); if (!hiveTable.getHiveTableMD().isMaterializedView()) { // If it is not a materialized view, we do not rewrite it throw new ReturnedValue(false); } if (containsAggregate && !AcidUtils.isFullAcidTable(hiveTable.getHiveTableMD())) { // If it contains an aggregate and it is not a full acid table, // we do not rewrite it (we need MERGE support) throw new ReturnedValue(false); } } else if (node instanceof Project) { // We can continue super.visit(node, ordinal, parent); } else { throw new ReturnedValue(false); } } }.go(union.getInput(1));
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof FlattenRel) { found = true; } super.visit(node, ordinal, parent); } }
/** * Starts an iteration. */ public RelNode go(RelNode p) { this.root = p; visit(p, 0, null); return root; } }
/** * Starts an iteration. */ public RelNode go(RelNode p) { this.root = p; visit(p, 0, null); return root; } }
public void visit(RelNode node, int ordinal, RelNode parent) { nodes.add(node); super.visit(node, ordinal, parent); } // CHECKSTYLE: IGNORE 1
public void childrenAccept(RelVisitor visitor) { List<RelNode> inputs = getInputs(); for (int i = 0; i < inputs.size(); i++) { visitor.visit(inputs.get(i), i, this); } }
public void visit( RelNode p, int ordinal, RelNode parent) { super.visit(p, ordinal, parent); p.collectVariablesUsed(variables); // Important! Remove stopped variables AFTER we visit children // (which what super.visit() does) variables.removeAll(p.getVariablesSet()); } }
@Override public void visit(final RelNode node, final int ordinal, final RelNode parent) { if (node instanceof TableScan) { usedTables.add(node.getTable().getQualifiedName()); } super.visit(node, ordinal, parent); } };
public void visit( RelNode p, int ordinal, RelNode parent) { super.visit(p, ordinal, parent); p.collectVariablesUsed(variables); // Important! Remove stopped variables AFTER we visit children // (which what super.visit() does) variables.removeAll(p.getVariablesSet()); } }
public void visit(RelNode node, int ordinal, RelNode parent) { try { stack.push(node); if (!node.isValid(Litmus.THROW, this)) { ++invalidCount; } super.visit(node, ordinal, parent); } finally { stack.pop(); } } }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan) { RelOptTable table = node.getTable(); List<String> qName = table.getQualifiedName(); names.add(qName); } super.visit(node, ordinal, parent); } }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan) { final RelOptCluster cluster = node.getCluster(); final RelOptTable.ToRelContext context = RelOptUtil.getContext(cluster); final RelNode r = node.getTable().toRel(context); plan.registerClass(r); } super.visit(node, ordinal, parent); } };
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan) { final RelOptCluster cluster = node.getCluster(); final RelOptTable.ToRelContext context = RelOptUtil.getContext(cluster); final RelNode r = node.getTable().toRel(context); planner.registerClass(r); } super.visit(node, ordinal, parent); } };