You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2017/01/28 06:17:22 UTC

zeppelin git commit: [ZEPPELIN-1982] When using the 'Select * ...' statement doesn't show …

Repository: zeppelin
Updated Branches:
  refs/heads/master 93e6e0bfc -> 12ab0e5e3


[ZEPPELIN-1982] When using the 'Select * ...' statement doesn't show \u2026

### What is this PR for?
In this ticket [ZEPPELIN-212](https://issues.apache.org/jira/browse/ZEPPELIN-212)\uff0c``InterpreterOutput.java`` will filter out '\n'.
It causes ``tabledata.js`` couldn't recognize the comment in the paragraphResult. If column number of sql query exceed 2 columns and row number over ``maxResult`` will show nothing.
Therefore, I suppose to modify comment statement from ''  to ``TABLE_COMMENT``for this issue.

### What type of PR is it?
Bug Fix

### Todos
* None

### What is the Jira issue?
[ZEPPELIN-1982](https://issues.apache.org/jira/browse/ZEPPELIN-1982)

### How should this be tested?
try  to execute ``%sql  SELECT * FROM bank`` on  tutorial

### Screenshots (if appropriate)
Before
![2017-01-25 14 49 40](https://cloud.githubusercontent.com/assets/3747345/22279334/8b3e6642-e30d-11e6-9e20-d6da015f016b.png)

After
![2017-01-25 14 48 59](https://cloud.githubusercontent.com/assets/3747345/22279909/da0922fa-e310-11e6-9c3e-34ef75b2ac81.png)

### Questions:
* Does the licenses files need update?
* Is there breaking changes for older versions?
* Does this needs documentation?

Author: Chin Tzulin <jp...@w022341412910m.local>

Closes #1942 from del680202/bug-1982 and squashes the following commits:

3808964 [Chin Tzulin] Fix problem of livy interpreter
e32d7b3 [Chin Tzulin] Fix test problem
ba6aab2 [Chin Tzulin] [ZEPPELIN-1982] When using the 'Select * ...' statement doesn't show the response In %sql interpreter


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/12ab0e5e
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/12ab0e5e
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/12ab0e5e

Branch: refs/heads/master
Commit: 12ab0e5e3199adb195be332d6cf64200c24a1844
Parents: 93e6e0b
Author: Chin Tzulin <jp...@w022341412910m.local>
Authored: Thu Jan 26 15:33:44 2017 +0900
Committer: Mina Lee <mi...@apache.org>
Committed: Sat Jan 28 15:17:14 2017 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java | 4 +++-
 zeppelin-web/src/app/tabledata/tabledata.js                      | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/12ab0e5e/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java
----------------------------------------------------------------------
diff --git a/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java b/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java
index 281a8f8..d1234df 100644
--- a/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java
+++ b/spark/src/main/java/org/apache/zeppelin/spark/ZeppelinContext.java
@@ -293,7 +293,9 @@ public class ZeppelinContext {
     }
 
     if (rows.length > maxResult) {
-      msg.append("\n<font color=red>Results are limited by " + maxResult + ".</font>");
+      msg.append("<!--TABLE_COMMENT-->");
+      msg.append("\n");
+      msg.append("<font color=red>Results are limited by " + maxResult + ".</font>");
     }
     sc.clearJobGroup();
     return msg.toString();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/12ab0e5e/zeppelin-web/src/app/tabledata/tabledata.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/tabledata/tabledata.js b/zeppelin-web/src/app/tabledata/tabledata.js
index 69fd5dc..950f456 100644
--- a/zeppelin-web/src/app/tabledata/tabledata.js
+++ b/zeppelin-web/src/app/tabledata/tabledata.js
@@ -37,12 +37,13 @@ export default class TableData {
 
     for (var i = 0; i < textRows.length; i++) {
       var textRow = textRows[i];
+
       if (commentRow) {
         comment += textRow;
         continue;
       }
 
-      if (textRow === '') {
+      if (textRow === '' || textRow === '<!--TABLE_COMMENT-->') {
         if (rows.length > 0) {
           commentRow = true;
         }