GitHub user zjffdu opened a pull request:
https://github.com/apache/zeppelin/pull/1232
ZEPPELIN-1197. Should print output directly without invoking function print
in pyspark interpreter
### What is this PR for?
For now, user need to invoke print to make the output displayed on the
notebook. This behavior is not natural and consistent with other notebooks.
This PR is to make the pyspark interpreter in zeppelin behave the same as other
notebook. 2 main changes
* use single mode to compile the last statement, so that the evaluation
result of the last statement will be printed to stdout, this is consistent with
other notebooks (like jupyter)
* Make SparkOutputStream extends LogOutputStream so that we can see the
output of inner process (Python/R), it is helpful for diagnosing.
### What type of PR is it?
[Bug Fix]
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-1197
### How should this be tested?
Tested it manually. Input the following text in pyspark paragraph,
```
1+1
sc.version
```
And get the following output
```
u'1.6.1'
```
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? User don't need to call
print explicitly.
* Does this needs documentation? Yes
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zjffdu/zeppelin ZEPPELIN-1197
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/1232.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1232
----
commit 10182e695014911fd2bbdbbc9e59fc960d9c4b72
Author: Jeff Zhang <[email protected]>
Date: 2016-07-27T05:29:17Z
ZEPPELIN-1197. Should print output directly without invoking function print
in pyspark interpreter
----
---
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.
---