public class TestSortImpl extends DrillTest
| Modifier and Type | Class and Description |
|---|---|
static class |
TestSortImpl.DataGenerator
Crude-but-effective data generator that produces pseudo-random data
that can be easily verified.
|
static class |
TestSortImpl.DataValidator
Validate a sort output batch based on the expectation that the key
is an ordered sequence of integers, split across multiple batches.
|
static class |
TestSortImpl.SortTestFixture
Handy fixture to hold a sort, a set of input row sets (batches) and the
output set of row sets (batches.) Pumps the input into the sort and
harvests the output.
|
DrillTest.MemWatcher| Modifier and Type | Field and Description |
|---|---|
BaseDirTestWatcher |
dirTestWatcher |
logOutcome, objectMapper, REPEAT_RULE, thrownException, TIMEOUT| Constructor and Description |
|---|
TestSortImpl() |
| Modifier and Type | Method and Description |
|---|---|
static SortImpl |
makeSortImpl(OperatorFixture fixture,
String sortOrder,
String nullOrder)
Create the sort implementation to be used by test.
|
void |
runJumboBatchTest(OperatorFixture fixture,
int rowCount)
Set up and run a test for "jumbo" batches, and time the run.
|
void |
runLargeSortTest(OperatorFixture fixture,
TestSortImpl.DataGenerator dataGen,
TestSortImpl.DataValidator validator)
Run a full-blown sort test with multiple input batches.
|
void |
runWideRowsTest(OperatorFixture fixture,
int colCount,
int rowCount)
Run a test using wide rows.
|
void |
testEmptyInput()
Test for an input with a schema, but only an empty input batch.
|
void |
testLargeBatch()
Hit the sort with the largest possible batch size to ensure nothing is lost
at the edges.
|
void |
testModerateBatch()
Most tests have used small row counts because we want to probe specific bits
of interest.
|
void |
testNullInput()
Test for null input (no input batches).
|
void |
testSingleBatch()
Degenerate case: two (unsorted) rows in single batch
|
void |
testSingleRow()
Degenerate case: single row in single batch.
|
void |
testSpill()
Force the sorter to spill, and verify that the resulting data
is correct.
|
void |
testTwoBatches()
Degenerate case, one row in each of two (unsorted) batches.
|
void |
testWideRows()
Test wide rows with the stock copier.
|
escapeJsonString, finishDrillTest, initDrillTestpublic final BaseDirTestWatcher dirTestWatcher
public static SortImpl makeSortImpl(OperatorFixture fixture, String sortOrder, String nullOrder)
fixture - operator fixturesortOrder - sort order as specified by Order.OrderingnullOrder - null order as specified by Order.Orderingpublic void testNullInput()
throws Exception
Exceptionpublic void testEmptyInput()
throws Exception
Exceptionpublic void testSingleRow()
throws Exception
Exceptionpublic void testSingleBatch()
throws Exception
Exceptionpublic void testTwoBatches()
throws Exception
Exceptionpublic void runLargeSortTest(OperatorFixture fixture, TestSortImpl.DataGenerator dataGen, TestSortImpl.DataValidator validator)
fixture - the operator test fixturedataGen - input batch generatorvalidator - validates output batchespublic void runJumboBatchTest(OperatorFixture fixture, int rowCount)
fixture - operator test fixturerowCount - number of rows to testpublic void testModerateBatch()
throws Exception
Exceptionpublic void testLargeBatch()
throws Exception
Exceptionpublic void runWideRowsTest(OperatorFixture fixture, int colCount, int rowCount)
fixture - operator test fixturecolCount - number of data (non-key) columnsrowCount - number of rows to generatepublic void testWideRows()
throws Exception
Exceptionpublic void testSpill()
throws Exception
ExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.