link3280 closed pull request #6616: [FLINK-10218] Allow writing DataSet without
explicit path parameter
URL: https://github.com/apache/flink/pull/6616
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
b/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
index 3dd4f6a8216..976a3c65f8c 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
+++ b/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);
+ }
+
/**
* Writes a DataSet using a {@link FileOutputFormat} to a specified
location.
* This method adds a data sink to the program.
----------------------------------------------------------------
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