((ProjectRel) insertRel.getInput(0)).getProjects(); if (insertRel.getInput(0).getInput(0) instanceof ProjectRel) { level2InsertExprs = ((ProjectRel) insertRel.getInput(0).getInput(0)) .getProjects(); JoinRel joinRel = (JoinRel) mergeSourceRel.getInput(0); int nSourceFields = joinRel.getLeft().getRowType().getFieldCount(); List<RexNode> projects = new ArrayList<RexNode>();
RelNode oldChildRel = rel.getInput(0); RelNode newChildRel = mapOldToNewRel.get(oldChildRel);
RelNode oldChildRel = rel.getInput(0); RelNode newChildRel = mapOldToNewRel.get(oldChildRel);
final RelNode seek = converted.left.getInput(0); // fragile final int keyCount = leftKeys.size(); final List<Integer> args = ImmutableIntList.range(0, keyCount);
(RelSubset) rel.getInput( previousOperand.ordinalInParent); List<RelNode> inputRels = input.set.getRelsFromAllSubsets();
public void onMatch(RelOptRuleCall call) { call.transformTo(call.rel(0).getInput(0)); } }
(RelSubset) rel.getInput( previousOperand.ordinalInParent); List<RelNode> inputRels = input.set.getRelsFromAllSubsets();
public void onMatch(RelOptRuleCall call) { call.transformTo(call.rel(0).getInput(0)); } }
((ProjectRel) insertRel.getInput(0)).getProjects(); if (insertRel.getInput(0).getInput(0) instanceof ProjectRel) { level2InsertExprs = ((ProjectRel) insertRel.getInput(0).getInput(0)) .getProjects(); JoinRel joinRel = (JoinRel) mergeSourceRel.getInput(0); int nSourceFields = joinRel.getLeft().getRowType().getFieldCount(); List<RexNode> projects = new ArrayList<RexNode>();
((ProjectRel) insertRel.getInput(0)).getProjects(); if (insertRel.getInput(0).getInput(0) instanceof ProjectRel) { level2InsertExprs = ((ProjectRel) insertRel.getInput(0).getInput(0)) .getProjects(); JoinRel joinRel = (JoinRel) mergeSourceRel.getInput(0); int nSourceFields = joinRel.getLeft().getRowType().getFieldCount(); List<RexNode> projects = new ArrayList<RexNode>();
public void onMatch(final RelOptRuleCall call) { JoinRelBase join = call.rel(0); if (!join.getSystemFieldList().isEmpty()) { // FIXME Enable this rule for joins with system fields return; } final RelNode swapped = swap(join); if (swapped == null) { return; } // The result is either a Project or, if the project is trivial, a // raw Join. final JoinRelBase newJoin = swapped instanceof JoinRelBase ? (JoinRelBase) swapped : (JoinRelBase) swapped.getInput(0); call.transformTo(swapped); // We have converted join='a join b' into swapped='select // a0,a1,a2,b0,b1 from b join a'. Now register that project='select // b0,b1,a0,a1,a2 from (select a0,a1,a2,b0,b1 from b join a)' is the // same as 'b join a'. If we didn't do this, the swap join rule // would fire on the new join, ad infinitum. final List<RexNode> exps = RelOptUtil.createSwappedJoinExprs(newJoin, join, false); RelNode project = projectFactory.createProject(swapped, exps, newJoin.getRowType().getFieldNames()); RelNode rel = call.getPlanner().ensureRegistered(project, newJoin); Util.discard(rel); }
: (JoinRel) swapped.getInput(0);
final RelNode input = rel.getInput(0); assertThat(input, instanceOf(AggregateRel.class)); assertThat(input.metadata(ColType.class).getColType(0),
&& ((CalcRel) rel).getProgram().isTrivial()) rel = rel.getInput(0);
rel = rel.getInput(0);