Package org.eigenbase.rel

Examples of org.eigenbase.rel.SortRel


    super(RelOptHelper.any(SortRel.class, Convention.NONE), "DrillLimitRule");
  }

  @Override
  public boolean matches(RelOptRuleCall call) {
    final SortRel sort = call.rel(0);
    return sort.offset != null || sort.fetch != null;
  }
View Full Code Here


    return sort.offset != null || sort.fetch != null;
  }

  @Override
  public void onMatch(RelOptRuleCall call) {
    final SortRel incomingSort = call.rel(0);
    final RelTraitSet incomingTraits = incomingSort.getTraitSet();
    RelNode input = incomingSort.getChild();

    // if the Optiq sort rel includes a collation and a limit, we need to create a copy the sort rel that excludes the
    // limit information.
    if (!incomingSort.getCollation().getFieldCollations().isEmpty()) {
      input = incomingSort.copy(incomingTraits, input, incomingSort.getCollation(), null, null);
    }

    RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
    call.transformTo(new DrillLimitRel(incomingSort.getCluster(), convertedInput.getTraitSet().plus(DrillRel.DRILL_LOGICAL), convertedInput, incomingSort.offset, incomingSort.fetch));
  }
View Full Code Here

    }

  @Override
  public void onMatch( RelOptRuleCall call )
    {
    SortRel rel = call.rel( 0 );

    // Cascading sort does not implement limits
    if( rel.offset != null || rel.fetch != null )
      return;

    RelTraitSet newTraits = rel.getTraitSet().plus( Cascading.CONVENTION );

    call.transformTo( new CascadingSortRel(
      rel.getCluster(),
      newTraits,
      convert( rel.getChild(), newTraits ),
      rel.getCollation(),
      rel.offset,
      rel.fetch ) );
    }
View Full Code Here

TOP

Related Classes of org.eigenbase.rel.SortRel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.