[ 
https://issues.apache.org/jira/browse/FLINK-16013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17035904#comment-17035904
 ] 

Yang Wang edited comment on FLINK-16013 at 2/13/20 6:00 AM:
------------------------------------------------------------

[~dwysakowicz] Thanks for your suggestion. It really makes sense to put the 
converting logic in {{convertToString}}.


was (Author: fly_in_gis):
[~dwysakowicz] Thanks for your suggestion. It really makes sense to put the 
converting {{List}} to string in {{convertToString}}.

> 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.
>  
> Also the Map, Duration type have the same problem.
>  
> 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)

Reply via email to