[
https://issues.apache.org/jira/browse/FLINK-2622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740054#comment-14740054
]
ASF GitHub Bot commented on FLINK-2622:
---------------------------------------
Github user HuangWHWHW commented on a diff in the pull request:
https://github.com/apache/flink/pull/1098#discussion_r39237069
--- Diff:
flink-staging/flink-streaming/flink-streaming-scala/src/test/java/org/apache/flink/streaming/scala/api/CsvOutputFormatITCase.java
---
@@ -36,6 +37,10 @@ protected void preSubmit() throws Exception {
@Override
protected void testProgram() throws Exception {
OutputFormatTestPrograms.wordCountToCsv(WordCountData.TEXT,
resultPath);
+ OutputFormatTestPrograms.wordCountToCsv(WordCountData.TEXT,
resultPath, 1);
--- End diff --
The `writeMode` by setting default is already exist.
It will check whether the file can be overwrite or not in
`FileOutputFormat.java`:
`private static final void initDefaultsFromConfiguration(Configuration
configuration) {
final boolean overwrite =
configuration.getBoolean(ConfigConstants
.FILESYSTEM_DEFAULT_OVERWRITE_KEY,
ConfigConstants.DEFAULT_FILESYSTEM_OVERWRITE);
DEFAULT_WRITE_MODE = overwrite ? WriteMode.OVERWRITE :
WriteMode.NO_OVERWRITE;
final boolean alwaysCreateDirectory =
configuration.getBoolean(ConfigConstants
.FILESYSTEM_OUTPUT_ALWAYS_CREATE_DIRECTORY_KEY,
ConfigConstants.DEFAULT_FILESYSTEM_ALWAYS_CREATE_DIRECTORY);
DEFAULT_OUTPUT_DIRECTORY_MODE = alwaysCreateDirectory ?
OutputDirectoryMode.ALWAYS : OutputDirectoryMode.PARONLY;
}`
> 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)