Btw, the code is at https://github.com/tnachen/incubator-drill/tree/limit_op
Tim On Sun, Sep 29, 2013 at 3:22 PM, Timothy Chen <[email protected]> wrote: > I tried that as well earlier, but still the same result. > > It's creating the input and sorts, but in the end it won't call the > DrillImplementor for Rels at all. > > I also tried taking out the replace, but same results too. > > It wonder if the best route (cheapest) as able to skip the one copied? > > I believe I followed mostly what you suggested that is follow > EnumerableLimitRel impl. > > Tim > > > > > On Sun, Sep 29, 2013 at 3:01 PM, Julian Hyde <[email protected]>wrote: > >> >> On Sep 28, 2013, at 1:01 AM, Timothy Chen <[email protected]> wrote: >> >> > Here is one of the trials I tried: >> > >> > - final RelTraitSet traits = >> sort.getTraitSet().plus(DrillRel.CONVENTION); >> > + final RelTraitSet traits = sort.getTraitSet(); >> > RelNode input = sort.getChild(); >> > if (!sort.getCollation().getFieldCollations().isEmpty()) { >> > input = sort.copy( >> > - sort.getTraitSet().replace(RelCollationImpl.EMPTY), >> > - input, >> > - RelCollationImpl.EMPTY, >> > + sort.getTraitSet(), >> > + sort, >> > + sort.getCollation(), >> > null, >> > null); >> > } >> >> The >> >> + sort, >> >> line should be >> >> + input, >> >> otherwise you are creating a sort on top of a sort. Give that a try. >> >> Julian >> >> >
