use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testMapType.
public void testMapType(OperatorFixture fixture) throws Exception {
BatchSchema schema = new SchemaBuilder().add("key", MinorType.INT).addMap("m1").add("b", MinorType.INT).addMap("m2").add("c", MinorType.INT).resumeMap().resumeSchema().build();
CopierTester tester = new CopierTester(fixture);
tester.addInput(fixture.rowSetBuilder(schema).addRow(1, objArray(10, objArray(100))).addRow(5, objArray(50, objArray(500))).withSv2().build());
tester.addInput(fixture.rowSetBuilder(schema).addRow(2, objArray(20, objArray(200))).addRow(6, objArray(60, objArray(600))).withSv2().build());
tester.addOutput(fixture.rowSetBuilder(schema).addRow(1, objArray(10, objArray(100))).addRow(2, objArray(20, objArray(200))).addRow(5, objArray(50, objArray(500))).addRow(6, objArray(60, objArray(600))).build());
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testEmptyBatch.
@Test
public void testEmptyBatch() throws Exception {
BatchSchema schema = SortTestUtilities.nonNullSchema();
CopierTester tester = new CopierTester(fixture);
tester.addInput(fixture.rowSetBuilder(schema).withSv2().build());
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testAscNullsLast.
@Test
public void testAscNullsLast() throws Exception {
BatchSchema schema = SortTestUtilities.nullableSchema();
CopierTester tester = new CopierTester(fixture);
tester.sortOrder = Ordering.ORDER_ASC;
tester.nullOrder = Ordering.NULLS_LAST;
tester.addInput(fixture.rowSetBuilder(schema).addRow(1, "1").addRow(4, "4").addRow(null, "null").withSv2().build());
tester.addInput(fixture.rowSetBuilder(schema).addRow(2, "2").addRow(3, "3").addRow(null, "null").withSv2().build());
tester.addOutput(fixture.rowSetBuilder(schema).addRow(1, "1").addRow(2, "2").addRow(3, "3").addRow(4, "4").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 testAscNullsFirst.
@Test
public void testAscNullsFirst() throws Exception {
BatchSchema schema = SortTestUtilities.nullableSchema();
CopierTester tester = new CopierTester(fixture);
tester.sortOrder = Ordering.ORDER_ASC;
tester.nullOrder = Ordering.NULLS_FIRST;
tester.addInput(fixture.rowSetBuilder(schema).addRow(null, "null").addRow(1, "1").addRow(4, "4").withSv2().build());
tester.addInput(fixture.rowSetBuilder(schema).addRow(null, "null").addRow(2, "2").addRow(3, "3").withSv2().build());
tester.addOutput(fixture.rowSetBuilder(schema).addRow(null, "null").addRow(null, "null").addRow(1, "1").addRow(2, "2").addRow(3, "3").addRow(4, "4").build());
tester.run();
}
use of org.apache.drill.exec.physical.impl.xsort.managed.SortTestUtilities.CopierTester in project drill by axbaretto.
the class TestCopier method testMultipleOutput.
@Test
public void testMultipleOutput() throws Exception {
BatchSchema schema = SortTestUtilities.nonNullSchema();
CopierTester tester = new CopierTester(fixture);
tester.addInput(makeDataSet(schema, 0, 2, 10).toIndirect());
tester.addInput(makeDataSet(schema, 1, 2, 10).toIndirect());
tester.addOutput(makeDataSet(schema, 0, 1, 10));
tester.addOutput(makeDataSet(schema, 10, 1, 10));
tester.run();
}
Aggregations