Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-6548: IllegalStateException: Unexpected EMIT outcome received i… #1352

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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:
Expand Down
Expand Up @@ -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);
}
}