use of org.apache.drill.exec.store.mock.MockStorePOP in project drill by apache.
the class TestHashJoinOutcome method beforeTest.
@Before
public void beforeTest() throws Exception {
prepareUninitContainers(uninitialized2ndInputContainersLeft, batchSchemaLeft);
prepareUninitContainers(uninitialized2ndInputContainersRight, batchSchemaRight);
nonEmptyInputRowSetRight = operatorFixture.rowSetBuilder(inputSchemaRight).addRow(123).build();
nonEmptyInputRowSetLeft = operatorFixture.rowSetBuilder(inputSchemaLeft).addRow(123).build();
// Prepare various (empty/non-empty) containers for each side of the join
emptyInputRowSetLeft = operatorFixture.rowSetBuilder(inputSchemaLeft).build();
emptyInputRowSetRight = operatorFixture.rowSetBuilder(inputSchemaRight).build();
inputContainerRight.add(emptyInputRowSetRight.container());
inputContainerRight.add(nonEmptyInputRowSetRight.container());
inputContainerLeft.add(emptyInputRowSetLeft.container());
inputContainerLeft.add(nonEmptyInputRowSetLeft.container());
final PhysicalOperator mockPopConfig = new MockStorePOP(null);
mockOpContext(mockPopConfig, 0, 0);
}
use of org.apache.drill.exec.store.mock.MockStorePOP in project drill by apache.
the class TestUnnestWithLateralCorrectness method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws Exception {
mockPopConfig = new MockStorePOP(null);
ljPopConfig = new LateralJoinPOP(null, null, JoinRelType.INNER, DrillLateralJoinRelBase.IMPLICIT_COLUMN, Lists.newArrayList());
operatorContext = fixture.newOperatorContext(mockPopConfig);
}
use of org.apache.drill.exec.store.mock.MockStorePOP in project drill by apache.
the class TestSortEmitOutcome method testSpillNotSupportedWithEmitOutcome.
/**
* Verifies ExternalSortBatch behavior when it sees batches with EMIT outcome but has to spill to disk because of
* memory pressure. Expectation is currenlty spilling is not supported with EMIT outcome so while preparing the
* output batch that will be detected and Sort will throw UnsupportedOperationException
* @throws Exception
*/
@Test(expected = UnsupportedOperationException.class)
public void testSpillNotSupportedWithEmitOutcome() throws Exception {
final OperatorFixture.Builder builder = OperatorFixture.builder(dirTestWatcher);
// Configuration that forces Sort to spill after buffering 2 incoming batches with data
builder.configBuilder().put(ExecConstants.EXTERNAL_SORT_BATCH_LIMIT, 2);
final OperatorFixture fixture_local = builder.build();
final RowSet.SingleRowSet local_EmptyInputRowSet = fixture_local.rowSetBuilder(inputSchema).build();
final RowSet.SingleRowSet local_nonEmptyInputRowSet1 = fixture_local.rowSetBuilder(inputSchema).addRow(3, 30, "item3").addRow(2, 20, "item2").build();
final RowSet.SingleRowSet local_nonEmptyInputRowSet2 = fixture_local.rowSetBuilder(inputSchema).addRow(1, 10, "item1").build();
final RowSet.SingleRowSet local_nonEmptyInputRowSet3 = fixture_local.rowSetBuilder(inputSchema).addRow(4, 40, "item4").build();
inputContainer.add(local_EmptyInputRowSet.container());
inputContainer.add(local_nonEmptyInputRowSet1.container());
inputContainer.add(local_nonEmptyInputRowSet2.container());
inputContainer.add(local_nonEmptyInputRowSet3.container());
inputContainer.add(local_EmptyInputRowSet.container());
inputOutcomes.add(OK_NEW_SCHEMA);
inputOutcomes.add(OK);
inputOutcomes.add(OK);
inputOutcomes.add(OK);
inputOutcomes.add(EMIT);
final PhysicalOperator mockPopConfig_local = new MockStorePOP(null);
final OperatorContext opContext_local = fixture_local.getFragmentContext().newOperatorContext(mockPopConfig_local);
final MockRecordBatch mockInputBatch = new MockRecordBatch(fixture_local.getFragmentContext(), opContext_local, inputContainer, inputOutcomes, local_EmptyInputRowSet.container().getSchema());
final ExternalSortBatch sortBatch_local = new ExternalSortBatch(sortPopConfig, fixture_local.getFragmentContext(), mockInputBatch);
assertTrue(sortBatch_local.next() == OK_NEW_SCHEMA);
// Should throw the exception
sortBatch_local.next();
// Release memory for row sets
local_EmptyInputRowSet.clear();
local_nonEmptyInputRowSet1.clear();
local_nonEmptyInputRowSet2.clear();
local_nonEmptyInputRowSet3.clear();
sortBatch_local.close();
fixture_local.close();
}
Aggregations