[ https://issues.apache.org/jira/browse/FLINK-4506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15562187#comment-15562187 ]
ASF GitHub Bot commented on FLINK-4506: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2477#discussion_r82594396 --- Diff: flink-java/src/test/java/org/apache/flink/api/java/io/CsvOutputFormatTest.java --- @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.api.java.io; + +import org.apache.commons.io.IOUtils; +import org.apache.flink.api.common.io.FileOutputFormat; +import org.apache.flink.api.java.tuple.Tuple3; +import org.apache.flink.core.fs.FSDataInputStream; +import org.apache.flink.core.fs.FileSystem; +import org.apache.flink.core.fs.Path; +import org.junit.After; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class CsvOutputFormatTest { + + private static final Path PATH = new Path("csv_output_test_file.csv"); --- End diff -- Please use `File.createTempFile()` to create a file in the default temp space. > CsvOutputFormat defaults allowNullValues to false, even though doc and > declaration says true > -------------------------------------------------------------------------------------------- > > Key: FLINK-4506 > URL: https://issues.apache.org/jira/browse/FLINK-4506 > Project: Flink > Issue Type: Bug > Components: Batch Connectors and Input/Output Formats, Documentation > Reporter: Michael Wong > Assignee: Kirill Morozov > Priority: Minor > > In the constructor, it has this > {code} > this.allowNullValues = false; > {code} > But in the setAllowNullValues() method, the doc says the allowNullValues is > true by default. Also, in the declaration of allowNullValues, the value is > set to true. It probably makes the most sense to change the constructor. > {code} > /** > * Configures the format to either allow null values (writing an empty > field), > * or to throw an exception when encountering a null field. > * <p> > * by default, null values are allowed. > * > * @param allowNulls Flag to indicate whether the output format should > accept null values. > */ > public void setAllowNullValues(boolean allowNulls) { > this.allowNullValues = allowNulls; > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)