zentol commented on a change in pull request #6616: [FLINK-10218] Allow writing
DataSet without explicit path parameter
URL: https://github.com/apache/flink/pull/6616#discussion_r212897718
##########
File path: flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
##########
@@ -1727,6 +1727,21 @@ public void printToErr() throws Exception {
return output(new PrintingOutputFormat<T>(sinkIdentifier,
true));
}
+ /**
+ * Writes a DataSet using a {@link FileOutputFormat} to a specified
location.
+ * This method adds a data sink to the program.
+ *
+ * @param outputFormat The FileOutputFormat to write the DataSet.
+ * @return The DataSink that writes the DataSet.
+ *
+ * @see FileOutputFormat
+ */
+ public DataSink<T> write(FileOutputFormat<T> outputFormat) {
+ Preconditions.checkNotNull(outputFormat, "Output format must
not be null.");
+ Preconditions.checkNotNull(outputFormat.getOutputFilePath(),
"File path must not be null.");
+ return output(outputFormat);
Review comment:
this right here is already a viable alternative for users, hence I would
reject this PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services