use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testMultipleOutputDesc.
// Also verifies that SV2s work
@Test
public void testMultipleOutputDesc() throws Exception {
BatchSchema schema = SortTestUtilities.nonNullSchema();
CopierTester tester = new CopierTester(fixture);
tester.sortOrder = Ordering.ORDER_DESC;
tester.nullOrder = Ordering.NULLS_UNSPECIFIED;
SingleRowSet input = makeDataSet(schema, 0, 2, 10).toIndirect();
RowSetUtilities.reverse(input.getSv2());
tester.addInput(input);
input = makeDataSet(schema, 1, 2, 10).toIndirect();
RowSetUtilities.reverse(input.getSv2());
tester.addInput(input);
tester.addOutput(makeDataSet(schema, 19, -1, 10));
tester.addOutput(makeDataSet(schema, 9, -1, 10));
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testDescNullsLast.
@Test
public void testDescNullsLast() throws Exception {
BatchSchema schema = SortTestUtilities.nullableSchema();
CopierTester tester = new CopierTester(fixture);
tester.sortOrder = Ordering.ORDER_DESC;
tester.nullOrder = Ordering.NULLS_LAST;
tester.addInput(fixture.rowSetBuilder(schema).addRow(4, "4").addRow(1, "1").addRow(null, "null").withSv2().build());
tester.addInput(fixture.rowSetBuilder(schema).addRow(3, "3").addRow(2, "2").addRow(null, "null").withSv2().build());
tester.addOutput(fixture.rowSetBuilder(schema).addRow(4, "4").addRow(3, "3").addRow(2, "2").addRow(1, "1").addRow(null, "null").addRow(null, "null").build());
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testTwoBatchesSingleRow.
@Test
public void testTwoBatchesSingleRow() throws Exception {
BatchSchema schema = SortTestUtilities.nonNullSchema();
CopierTester tester = new CopierTester(fixture);
tester.addInput(fixture.rowSetBuilder(schema).addRow(10, "10").withSv2().build());
tester.addInput(fixture.rowSetBuilder(schema).addRow(20, "20").withSv2().build());
tester.addOutput(fixture.rowSetBuilder(schema).addRow(10, "10").addRow(20, "20").build());
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method runTypeTest.
public static void runTypeTest(OperatorFixture fixture, MinorType type) throws Exception {
BatchSchema schema = SortTestUtilities.makeSchema(type, false);
CopierTester tester = new CopierTester(fixture);
tester.addInput(makeDataSet(schema, 0, 2, 5).toIndirect());
tester.addInput(makeDataSet(schema, 1, 2, 5).toIndirect());
tester.addOutput(makeDataSet(schema, 0, 1, 10));
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testDescNullsFirst.
@Test
public void testDescNullsFirst() throws Exception {
BatchSchema schema = SortTestUtilities.nullableSchema();
CopierTester tester = new CopierTester(fixture);
tester.sortOrder = Ordering.ORDER_DESC;
tester.nullOrder = Ordering.NULLS_FIRST;
tester.addInput(fixture.rowSetBuilder(schema).addRow(null, "null").addRow(4, "4").addRow(1, "1").withSv2().build());
tester.addInput(fixture.rowSetBuilder(schema).addRow(null, "null").addRow(3, "3").addRow(2, "2").withSv2().build());
tester.addOutput(fixture.rowSetBuilder(schema).addRow(null, "null").addRow(null, "null").addRow(4, "4").addRow(3, "3").addRow(2, "2").addRow(1, "1").build());
tester.run();
}
Aggregations