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

Kostas Kloudas commented on FLINK-15533:
----------------------------------------

Thanks for reporting this [~lirui] and also thanks for digging into it. I agree 
that this seems to be the problem and it should be fixed.

My first thought is that the 
{{consolidateParallelismDefinitionsInConfiguration}} should change to be {{if 
(config.getParallelism() == ExecutionConfig.PARALLELISM_DEFAULT)}} and it 
should be called from within the {{getParallelism()}}  so that we have a 
consistent view across the whole codebase. 

Another thing that I would like to point is also that this 
[check|https://github.com/kl0u/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/common/io/FileOutputFormat.java#L223]
 seems a bit weird to me. I would suggest that no matter what the parallelism 
is, the behaviour should be the same, i.e. always create a directory.

What do you think?

> Writing DataStream as text file fails due to output path already exists
> -----------------------------------------------------------------------
>
>                 Key: FLINK-15533
>                 URL: https://issues.apache.org/jira/browse/FLINK-15533
>             Project: Flink
>          Issue Type: Bug
>          Components: Client / Job Submission
>    Affects Versions: 1.10.0
>            Reporter: Rui Li
>            Priority: Major
>
> The following program reproduces the issue.
> {code}
>     Configuration configuration = GlobalConfiguration.loadConfiguration();
>     configuration.set(DeploymentOptions.TARGET, RemoteExecutor.NAME);
>     StreamExecutionEnvironment streamEnv = new 
> StreamExecutionEnvironment(configuration);
>     DataStream dataStream = streamEnv.fromCollection(Arrays.asList(1,2,3));
>     dataStream.writeAsText("hdfs://localhost:8020/tmp/output");
>     streamEnv.execute();
> {code}
> The job will fail with the follow error, even though the output path doesn't 
> exist before job submission:
> {noformat}
> org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.fs.FileAlreadyExistsException):
>  /tmp/output already exists as a directory
> {noformat}



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

Reply via email to