Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/672#discussion_r30330465
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/DataSet.java 
---
    @@ -1337,11 +1336,16 @@ public long count() throws Exception {
        /**
         * Writes a DataSet to the standard output stream (stdout).<br/>
         * For each element of the DataSet the result of {@link 
Object#toString()} is written.
    -    * 
    -    *  @return The DataSink that writes the DataSet.
         */
    -   public DataSink<T> print() {
    -           return output(new PrintingOutputFormat<T>(false));
    +   public void print() {
    +           try {
    +                   List<T> elements = this.collect();
    +                   for (T e: elements) {
    +                           System.out.println(e);
    +                   }
    +           } catch (Exception e) {
    +                   System.out.println("Could not retrieve values for 
printing: " + e);
    --- End diff --
    
    This prints only the message. I would suggest to stringify the exception 
because the error messages coming from `collect()` might come from the remote 
cluster


---
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