use of org.apache.flink.table.api.TableConfig in project flink by apache.
the class CodeSplitTest method runTest.
private void runTest(Consumer<TableConfig> consumer) {
TableConfig splitTableConfig = new TableConfig();
splitTableConfig.set(TableConfigOptions.MAX_LENGTH_GENERATED_CODE, 4000);
splitTableConfig.set(TableConfigOptions.MAX_MEMBERS_GENERATED_CODE, 10000);
consumer.accept(splitTableConfig);
TableConfig noSplitTableConfig = new TableConfig();
noSplitTableConfig.set(TableConfigOptions.MAX_LENGTH_GENERATED_CODE, Integer.MAX_VALUE);
noSplitTableConfig.set(TableConfigOptions.MAX_MEMBERS_GENERATED_CODE, Integer.MAX_VALUE);
PrintStream originalStdOut = System.out;
try {
// redirect stdout to a null output stream to silence compile error in CompileUtils
System.setOut(new PrintStream(new OutputStream() {
@Override
public void write(int b) throws IOException {
}
}));
consumer.accept(noSplitTableConfig);
Assert.fail("Expecting compiler exception");
} catch (Exception e) {
MatcherAssert.assertThat(e, FlinkMatchers.containsMessage("grows beyond 64 KB"));
} finally {
// set stdout back
System.setOut(originalStdOut);
}
}
Aggregations