You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yang Wang (Jira)" <ji...@apache.org> on 2020/02/13 04:21:00 UTC

[jira] [Updated] (FLINK-16013) List and map config options could not be parsed correctly

     [ https://issues.apache.org/jira/browse/FLINK-16013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yang Wang updated FLINK-16013:
------------------------------
    Summary: List and map config options could not be parsed correctly  (was: List and map config option could not be parsed correctly)

> List and map config options could not be parsed correctly
> ---------------------------------------------------------
>
>                 Key: FLINK-16013
>                 URL: https://issues.apache.org/jira/browse/FLINK-16013
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Configuration
>    Affects Versions: 1.10.0
>            Reporter: Yang Wang
>            Assignee: Yang Wang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.10.1, 1.11.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, if a config option is {{List}} type and written to a flink-conf.yaml, it could not be parsed correctly when reloaded from yaml resource. The root cause is we use {{List#toString}} to save into the yaml resource. However, when we want to parse a List from a string, we use semicolon to split the value.
>  
> The following is a unit test to reproduce this problem.
> {code:java}
> public void testWriteConfigurationAndReload() throws IOException {
>  final File flinkConfDir = temporaryFolder.newFolder().getAbsoluteFile();
>  final Configuration flinkConfig = new Configuration();
>  final ConfigOption<List<String>> listConfigOption = ConfigOptions
>   .key("test-list-string-key")
>   .stringType()
>   .asList()
>   .noDefaultValue();
>  final List<String> values = Arrays.asList("value1", "value2", "value3");
>  flinkConfig.set(listConfigOption, values);
>  assertThat(values, Matchers.containsInAnyOrder(flinkConfig.get(listConfigOption).toArray()));
>  BootstrapTools.writeConfiguration(flinkConfig, new File(flinkConfDir, "flink-conf.yaml"));
>  final Configuration loadedFlinkConfig = GlobalConfiguration.loadConfiguration(flinkConfDir.getAbsolutePath());
>  assertThat(values, Matchers.containsInAnyOrder(loadedFlinkConfig.get(listConfigOption).toArray()));
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)