@Override public Void visitPrel(final Prel prel, Void dummy) { for (Prel child : prel) { child.accept(this, dummy); } return null; }
@Override public LeafPrel visitPrel(Prel prel, Void v) { LeafPrel leafPrel = null; for (Prel child : prel) { leafPrel = child.accept(this, v); if (leafPrel != null) { return leafPrel; } } return null; }
@Override public Void visitPrel(Prel prel, Frag value) throws RuntimeException { for (Prel children : prel) { children.accept(this, value); } return null; }
@Override public Void visitExchange(ExchangePrel prel, Frag value) throws RuntimeException { Frag newFrag = new Frag(prel); frags.add(newFrag); value.children.add(newFrag); for (Prel child : prel) { child.accept(this, newFrag); } return null; }
@Override public Prel visitPrel(Prel prel, Void dummy) { List<RelNode> children = new ArrayList<>(); for(Prel p : prel){ children.add(p.accept(this, null)); } return (Prel) prel.copy(prel.getTraitSet(), children); }
@Override public Prel visitPrel(Prel prel, Void value) throws RuntimeException { List<RelNode> children = Lists.newArrayList(); for(Prel child : prel){ children.add(child.accept(this, null)); } return (Prel) prel.copy(prel.getTraitSet(), children); } }
@Override public Prel visitPrel(Prel prel, Void value) throws RuntimeException { List<RelNode> children = Lists.newArrayList(); for(Prel child : prel){ child = child.accept(this, null); children.add(child); } return (Prel) prel.copy(prel.getTraitSet(), children); }
@Override public Prel visitPrel(Prel prel, Object value) throws RelConversionException { List<RelNode> children = Lists.newArrayList(); for(Prel child : prel){ child = child.accept(this, null); children.add(child); } return (Prel) prel.copy(prel.getTraitSet(), children); }
@Override public Prel visitPrel(Prel prel, Void value) throws RuntimeException { List<RelNode> children = Lists.newArrayList(); for(Prel child : prel){ children.add(child.accept(this, null)); } return (Prel) prel.copy(prel.getTraitSet(), children); } }
@Override public Prel visitPrel(Prel prel, Double value) throws RuntimeException { List<RelNode> children = Lists.newArrayList(); for(Prel child : prel){ child = child.accept(this, value); children.add(child); } return (Prel) prel.copy(prel.getTraitSet(), children); }
@Override public Prel visitPrel(Prel prel, Void value) throws RuntimeException { List<RelNode> children = Lists.newArrayList(); for(Prel p : prel) { children.add(p.accept(this, null)); } return (Prel) prel.copy(prel.getTraitSet(), children); }
@Override public Prel visitPrel(Prel prel, Void value) throws RuntimeException { List<RelNode> newInputs = new ArrayList<>(); for(Prel input : prel){ newInputs.add(input.accept(this, null)); } return (Prel) prel.copy(prel.getTraitSet(), newInputs); }
public static Prel eliminateEmptyTrees(SqlHandlerConfig config, Prel prel) throws RelConversionException { final Limit0Converter converter = new Limit0Converter(config); try { return prel.accept(converter, null); }catch (IOException ex){ throw new RelConversionException("Failure while attempting to convert limit 0 to empty rel."); } }
@Override public Prel visitWriter(WriterPrel prel, Void value) throws RuntimeException { RelNode child = ((Prel) prel.getInput(0)).accept(this, null); if (prefixedForStar) { prefixedForWriter = true; // return insertProjUnderScreenOrWriter(prel, prel.getInput().getRowType(), child); return (Prel) prel.copy(prel.getTraitSet(), Collections.singletonList(child)); } else { return prel; } }
@Override public Prel visitPrel(Prel prel, Void value) throws RuntimeException { SelectionVectorMode[] encodings = prel.getSupportedEncodings(); List<RelNode> children = Lists.newArrayList(); for (Prel child : prel) { child = child.accept(this, null); children.add(convert(encodings, child)); } return (Prel) prel.copy(prel.getTraitSet(), children); }
@Override public Prel visitScreen(ScreenPrel prel, Void value) throws RuntimeException { Prel newChild = ((Prel) prel.getInput()).accept(this, value); return prel.copy(prel.getTraitSet(), Collections.singletonList( (RelNode) addTrivialOrderedProjectPrel(newChild, true))); }
@Override public Prel visitWriter(WriterPrel prel, Void value) throws RuntimeException { Prel newChild = ((Prel) prel.getInput()).accept(this, null); return prel.copy(prel.getTraitSet(), Collections.singletonList( (RelNode) addTrivialOrderedProjectPrel(newChild, true))); }
@Override public Prel visitProject(ProjectPrel project, Object unused) throws RelConversionException { RelNode transformedInput = ((Prel)project.getInput()).accept(this, null); Prel accepted = (Prel) SplitUpComplexExpressions.visitProject(project, transformedInput, funcReg); if (accepted == null) { return (ProjectPrel) project.copy(project.getTraitSet(), Lists.newArrayList(transformedInput)); } else { return accepted; } }
public static Prel insertHashProjects(Prel prel, OptionManager options) { final boolean isVectorizedPartitionSender = options.getOption(ExecConstants.ENABLE_VECTORIZED_PARTITIONER); final boolean muxEnabled = options.getOption(PlannerSettings.MUX_EXCHANGE); if (isVectorizedPartitionSender || muxEnabled) { return prel.accept(new InsertHashProjectVisitor(), null); } return prel; }