Skip to content
Permalink
Browse files
DRILL-6548: IllegalStateException: Unexpected EMIT outcome received i…
…n buildSchema phase

closes #1352
  • Loading branch information
Sorabh Hamirwasia authored and vvysotskyi committed Jul 1, 2018
1 parent 8ec2dc6 commit bf40c5ca84c7a3c783984369564dc151349114b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
@@ -174,6 +174,7 @@ public void buildSchema() throws SchemaChangeException {
return;
case NONE:
state = BatchState.DONE;
return;
case EMIT:
throw new IllegalStateException("Unexpected EMIT outcome received in buildSchema phase");
default:
@@ -638,4 +638,20 @@ public void testRegularTopNWithEmptyDataSet() {
assertTrue(topNBatch.next() == RecordBatch.IterOutcome.OK_NEW_SCHEMA);
assertTrue(topNBatch.next() == RecordBatch.IterOutcome.NONE);
}

@Test
public void testRegularTopNWithEmptyDataSetAndNoneOutcome() {
inputContainer.add(emptyInputRowSet.container());
inputOutcomes.add(RecordBatch.IterOutcome.NONE);

final MockRecordBatch mockInputBatch = new MockRecordBatch(operatorFixture.getFragmentContext(), opContext,
inputContainer, inputOutcomes, emptyInputRowSet.container().getSchema());

final TopN topNConfig = new TopN(null,
Lists.newArrayList(ordering("id_left", RelFieldCollation.Direction.DESCENDING,
RelFieldCollation.NullDirection.FIRST)), false, 4);
final TopNBatch topNBatch = new TopNBatch(topNConfig, operatorFixture.getFragmentContext(), mockInputBatch);

assertTrue(topNBatch.next() == RecordBatch.IterOutcome.NONE);
}
}

0 comments on commit bf40c5c

Please sign in to comment.