calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jess Balint <jbal...@gmail.com>
Subject how does SortRemoveRule work?
Date Fri, 14 Oct 2016 21:33:18 GMT
Just doing a bit of code reading here. Looking at the SortRemoveRule
implementation:

    // Express the "sortedness" requirement in terms of a collation trait
and
    // we can get rid of the sort. This allows us to use rels that just
happen
    // to be sorted but get the same effect.
    final RelCollation collation = sort.getCollation();
    assert collation == sort.getTraitSet()
        .getTrait(RelCollationTraitDef.INSTANCE);
    final RelTraitSet traits =
sort.getInput().getTraitSet().replace(collation);
    call.transformTo(convert(sort.getInput(), traits));

I don't understand how this is correct without checking that the input
collation is the same as the collation requested by the sort. It looks to
me like it just replaces the input's collation with that of the sort. Any
thoughts?

Thanks.

Jess

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message