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;
        }`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to