use of org.apache.flink.table.client.gateway.TypedResult in project flink by apache.
the class CliTableauResultViewTest method testEmptyBatchResult.
@Test
public void testEmptyBatchResult() {
final Configuration testConfig = new Configuration();
testConfig.set(EXECUTION_RESULT_MODE, ResultMode.TABLEAU);
testConfig.set(RUNTIME_MODE, RuntimeExecutionMode.BATCH);
ResultDescriptor resultDescriptor = new ResultDescriptor("", schema, true, testConfig, rowDataToStringConverter);
TestingExecutor mockExecutor = new TestingExecutorBuilder().setResultChangesSupplier(TypedResult::endOfStream).setResultPageSupplier(() -> {
throw new SqlExecutionException("query failed");
}).build();
CliTableauResultView view = new CliTableauResultView(terminal, mockExecutor, "session", resultDescriptor);
view.displayResults();
view.close();
Assert.assertEquals("Empty set" + System.lineSeparator(), terminalOutput.toString());
assertThat(mockExecutor.getNumCancelCalls(), is(0));
}
Aggregations