Search in sources :

Example 11 with ExternalSort

use of org.apache.drill.exec.physical.config.ExternalSort in project drill by apache.

the class TestSortEmitOutcome method defineOrdering.

@BeforeClass
public static void defineOrdering() {
    String columnToSort = inputSchema.column(0).getName();
    FieldReference expr = FieldReference.getWithQuotedRef(columnToSort);
    Order.Ordering ordering = new Order.Ordering(Order.Ordering.ORDER_ASC, expr, Order.Ordering.NULLS_FIRST);
    sortPopConfig = new ExternalSort(null, Lists.newArrayList(ordering), false);
}
Also used : Order(org.apache.drill.common.logical.data.Order) FieldReference(org.apache.drill.common.expression.FieldReference) ExternalSort(org.apache.drill.exec.physical.config.ExternalSort) BeforeClass(org.junit.BeforeClass)

Example 12 with ExternalSort

use of org.apache.drill.exec.physical.config.ExternalSort in project drill by apache.

the class SortPrel method getPhysicalOperator.

@Override
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
    Prel child = (Prel) this.getInput();
    PhysicalOperator childPOP = child.getPhysicalOperator(creator);
    org.apache.drill.exec.physical.config.Sort g = new ExternalSort(childPOP, PrelUtil.getOrdering(this.collation, getInput().getRowType()), false);
    return creator.addMetadata(this, g);
}
Also used : PhysicalOperator(org.apache.drill.exec.physical.base.PhysicalOperator) ExternalSort(org.apache.drill.exec.physical.config.ExternalSort)

Aggregations

ExternalSort (org.apache.drill.exec.physical.config.ExternalSort)12 Test (org.junit.Test)6 PhysicalOperator (org.apache.drill.exec.physical.base.PhysicalOperator)5 FieldReference (org.apache.drill.common.expression.FieldReference)3 OperatorTest (org.apache.drill.categories.OperatorTest)2 Ordering (org.apache.drill.common.logical.data.Order.Ordering)2 MinorFragmentEndpoint (org.apache.drill.exec.physical.MinorFragmentEndpoint)2 DrillTest (org.apache.drill.test.DrillTest)2 LinkedList (java.util.LinkedList)1 Order (org.apache.drill.common.logical.data.Order)1 OptionManager (org.apache.drill.exec.server.options.OptionManager)1 LegacyOperatorTestBuilder (org.apache.drill.test.LegacyOperatorTestBuilder)1 BeforeClass (org.junit.BeforeClass)1