setCurrent(call.getPlanner().getRoot(), correlate);
@Override public void onMatch(RelOptRuleCall call) { final Join join = call.rel(0); final HepRelVertex root = (HepRelVertex) call.getPlanner().getRoot(); if (root.getCurrentRel() != join) { // Bail out return; } // The join is the root, but we should always end up with a Project operator // on top. We will add it. RelBuilder relBuilder = call.builder(); relBuilder.push(join); List<RexNode> identityFields = relBuilder.fields( ImmutableBitSet.range(0, join.getRowType().getFieldCount()).asList()); relBuilder.project(identityFields, ImmutableList.<String>of(), true); call.transformTo(relBuilder.build()); }
setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
private MatchFunction getMatchIfRoot(RelOptRuleCall call) { List<RelNode> rels = call.getRelList(); if (call.getPlanner().getRoot().equals(call.rel(0))) { if (rels.size() == 2) { if ((rels.get(0) instanceof DrillFilterRel) && (rels.get(1) instanceof DrillScanRel)) { return ((DbScanToIndexScanPrule)FILTER_SCAN).match; } } else if (rels.size() == 3) { if ((rels.get(0) instanceof DrillFilterRel) && (rels.get(1) instanceof DrillProjectRel) && (rels.get(2) instanceof DrillScanRel)) { return ((DbScanToIndexScanPrule)FILTER_PROJECT_SCAN).match; } } } return null; }
private String getPlanDump(RelOptPlanner planner) { if (planner == null) { return null; } // Use VolcanoPlanner#dump to get more detailed information if (planner instanceof VolcanoPlanner) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ((VolcanoPlanner) planner).dump(pw); pw.flush(); return sw.toString(); } // Print the current tree otherwise RelNode root = planner.getRoot(); return RelOptUtil.toString(root); } @Override
static private boolean isFullQuery(IndexCallContext indexContext) { RelNode rootInCall = indexContext.getCall().rel(0); // check if the tip of the operator stack we have is also the top of the whole query, if yes, return true if (indexContext.getCall().getPlanner().getRoot() instanceof RelSubset) { final RelSubset rootSet = (RelSubset) indexContext.getCall().getPlanner().getRoot(); if (rootSet.getRelList().contains(rootInCall)) { return true; } } else { if (indexContext.getCall().getPlanner().getRoot().equals(rootInCall)) { return true; } } return false; }
setCurrent(call.getPlanner().getRoot(), correlate);
setCurrent(call.getPlanner().getRoot(), correlate);
setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);
final RelOptCluster cluster = correlate.getCluster(); setCurrent(call.getPlanner().getRoot(), correlate);