[
https://issues.apache.org/jira/browse/FLINK-2622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740061#comment-14740061
]
ASF GitHub Bot commented on FLINK-2622:
---------------------------------------
Github user HuangWHWHW commented on the pull request:
https://github.com/apache/flink/pull/1098#issuecomment-139436457
@fhueske
Hi, if I change to the NO_OVERWRITE in the `CsvOutputFormatITCase.java`,
tests will fail with errors following:
`Caused by: java.io.IOException: File already
exists:file:/C:/Users/H00292~1/AppData/Local/Temp/org.apache.flink.streaming.scala.api.CsvOutputFormatITCase-result/1
at
org.apache.flink.core.fs.local.LocalFileSystem.create(LocalFileSystem.java:247)
at
org.apache.flink.core.fs.local.LocalFileSystem.create(LocalFileSystem.java:263)
at
org.apache.flink.api.common.io.FileOutputFormat.open(FileOutputFormat.java:247)
at
org.apache.flink.api.scala.operators.ScalaCsvOutputFormat.open(ScalaCsvOutputFormat.java:161)
at
org.apache.flink.streaming.api.functions.sink.FileSinkFunction.open(FileSinkFunction.java:58)
at
org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:33)
at
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:69)
at
org.apache.flink.streaming.runtime.tasks.StreamTask.openAllOperators(StreamTask.java:232)
at
org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:167)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:581)
at java.lang.Thread.run(Thread.java:722)`
This is due to the exist file check in `LocalFileSystem.java`.
See the code following:
`if (exists(f) && !overwrite) {
throw new IOException("File already exists:" + f);
}`
> Scala DataStream API does not have writeAsText method which supports WriteMode
> ------------------------------------------------------------------------------
>
> Key: FLINK-2622
> URL: https://issues.apache.org/jira/browse/FLINK-2622
> Project: Flink
> Issue Type: Bug
> Components: Scala API, Streaming
> Reporter: Till Rohrmann
>
> The Scala DataStream API, unlike the Java DataStream API, does not support a
> {{writeAsText}} method which takes the {{WriteMode}} as a parameter. In order
> to make the two APIs consistent, it should be added to the Scala DataStream
> API.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)