matriv commented on a change in pull request #19232:
URL: https://github.com/apache/flink/pull/19232#discussion_r835073047
##########
File path:
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/api/CompiledPlanITCase.java
##########
@@ -315,6 +318,46 @@ public void testExplainPlan() throws IOException {
.isEqualTo(expected);
}
+ @Test
+ public void testPersistedConfigOption() throws Exception {
+ Path planPath =
Paths.get(URI.create(getTempDirPath("plan")).getPath(), "plan.json");
+ FileUtils.createParentDirectories(planPath.toFile());
+
+ List<String> data =
+ Stream.concat(
+ DATA.stream(),
+ Stream.of(
+ "4,2,This string is long",
+ "5,3,This is an even longer string"))
+ .collect(Collectors.toList());
+ String[] sinkColumnDefinitions = new String[] {"a bigint", "b int", "c
varchar(11)"};
+
+ createTestCsvSourceTable("src", data, COLUMNS_DEFINITION);
+ File sinkPath = createTestCsvSinkTable("sink", sinkColumnDefinitions);
+
+ // Set config option to trim the strings, so it's persisted in the
json plan
+ tableEnv.getConfig()
+ .getConfiguration()
+ .set(
+
ExecutionConfigOptions.TABLE_EXEC_SINK_TYPE_LENGTH_ENFORCER,
+ ExecutionConfigOptions.TypeLengthEnforcer.TRIM_PAD);
+ CompiledPlan plan = tableEnv.compilePlanSql("insert into sink select *
from src");
Review comment:
Yes, makes sense!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]