Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
The FlinkInterpreter does not properly captures the standard output when using System.out.println. The reason is that Zeppelin only sets the redirection for the Console which is used by Scala's Predef imports of print and println. However, some of Flink's code is written in Java and, thus, uses System.out for standard output. This output won't be captured.
The problem can be observed by executing the following code
val input = env.fromElements("a", "b", "c") input.print()
This code should output "a\nb\nc" or another permutation of a,b and c. However, nothing is printed. The current way for solving the problem is to manually collect the DataSet and to print it with Console.println. E.g.
val input = env.fromElements("a", "b", "c") input.collect().foreach{println}
I propose to change the behaviour of Zeppelin's Flink interpreter to properly capture all standard output to avoid these workarounds.