zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mina...@apache.org
Subject zeppelin git commit: [ZEPPELIN-1982] When using the 'Select * ...' statement doesn't show …
Date Sat, 28 Jan 2017 06:17:34 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 0564cd6ad -> 02709c0e7


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

### What is this PR for?
In this ticket [ZEPPELIN-212](https://issues.apache.org/jira/browse/ZEPPELIN-212),``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 <jp20316@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

(cherry picked from commit 12ab0e5e3199adb195be332d6cf64200c24a1844)
Signed-off-by: Mina Lee <minalee@apache.org>


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

Branch: refs/heads/branch-0.7
Commit: 02709c0e733b0879cd72c22a639ba575e7465c49
Parents: 0564cd6
Author: Chin Tzulin <jp20316@w022341412910m.local>
Authored: Thu Jan 26 15:33:44 2017 +0900
Committer: Mina Lee <minalee@apache.org>
Committed: Sat Jan 28 15:17:28 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/02709c0e/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/02709c0e/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;
         }


Mime
View raw message