zeppelin git commit: [ZEPPELIN-3014] NPE bug fix and Error message enhancement with Kylin Interpreter

2017-12-13 Thread zjffdu
Repository: zeppelin
Updated Branches:
  refs/heads/master 3505625c2 -> 549bce673


[ZEPPELIN-3014] NPE bug fix and Error message enhancement with Kylin Interpreter

### What is this PR for?
A few sentences describing the overall goals of the pull request's commits.
First time? Check out the contributing guide - 
https://zeppelin.apache.org/contribution/contributions.html

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

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3014

### How should this be tested?
*  Setup Travis CI as described on 
https://zeppelin.apache.org/contribution/contributions.html#continuous-integration
* Use existing unit tests in kylin module.

### Screenshots (if appropriate)

 before: NPE when result set is empty
![image](https://user-images.githubusercontent.com/18542573/32154048-f1b8ba58-bcfb-11e7-98cc-98cdf484f2d5.png)
 after: no NPE when result set is empty, just an empty table
![image](https://user-images.githubusercontent.com/18542573/32154069-110215d0-bcfc-11e7-87e9-cc049001f1c7.png)

 before: when query fails, only error code is returned, no error message
![image](https://user-images.githubusercontent.com/18542573/32154088-29651938-bcfc-11e7-9e66-cd2cfccba054.png)
 after: when query fails, both error code and error message are displayed 
to users
![image](https://user-images.githubusercontent.com/18542573/32154096-3d3ab01c-bcfc-11e7-8cf3-d710d96b8c5a.png)

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

Author: Liu 

Closes #2645 from jinxliu/kylin-intp-new and squashes the following commits:

d5692bf [Liu] refactor
85b6424 [Liu] add test for empty result set
4596470 [Liu] ZEPPELIN-3014: NPE bug fix and Error message enhancement with 
Kylin Interpreter


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

Branch: refs/heads/master
Commit: 549bce6738ffd7f460867d3f5ee00a9e2ec14125
Parents: 3505625
Author: Liu 
Authored: Tue Dec 5 15:24:20 2017 +0800
Committer: Jeff Zhang 
Committed: Wed Dec 13 18:54:06 2017 +0800

--
 .../zeppelin/kylin/KylinErrorResponse.java  | 63 +
 .../apache/zeppelin/kylin/KylinInterpreter.java | 71 
 .../zeppelin/kylin/KylinInterpreterTest.java| 24 +++
 3 files changed, 130 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/549bce67/kylin/src/main/java/org/apache/zeppelin/kylin/KylinErrorResponse.java
--
diff --git 
a/kylin/src/main/java/org/apache/zeppelin/kylin/KylinErrorResponse.java 
b/kylin/src/main/java/org/apache/zeppelin/kylin/KylinErrorResponse.java
new file mode 100644
index 000..00439e8
--- /dev/null
+++ b/kylin/src/main/java/org/apache/zeppelin/kylin/KylinErrorResponse.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.zeppelin.kylin;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonSyntaxException;
+import org.apache.zeppelin.common.JsonSerializable;
+
+/**
+ * class for Kylin Error Response.
+ */
+class KylinErrorResponse implements JsonSerializable {
+  private static final Gson gson = new Gson();
+
+  private String stacktrace;
+  private String exception;
+  private String url;
+  private String code;
+  private Object data;
+  private String msg;
+
+  public KylinErrorResponse(String stacktrace, String exception, String url,
+  String code, Object data, String msg) {
+this.stacktrace = stacktrace;
+this.exception = exception;
+this.url = url;
+this.code = code;
+this.data = data;
+this.msg = msg;
+  }
+
+  public String getException() {
+return exception;
+  }
+
+  public String toJson() {
+

zeppelin git commit: [HOTFIX]: Fix IPythonInterpreter unit test

2017-12-13 Thread zjffdu
Repository: zeppelin
Updated Branches:
  refs/heads/master 4a679fc05 -> 3505625c2


[HOTFIX]: Fix IPythonInterpreter unit test

### What is this PR for?

This is for hotfix of `IPythonInterpreter` unit test failure. Just specify the 
version of ipython in `install_external_dependencies.sh`, otherwise latest 
ipython version will be installed, and the behavior may change.

### What type of PR is it?
[Hot Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
*

### How should this be tested?
* CI pass

### Screenshots (if appropriate)

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

Author: Jeff Zhang 

Closes #2703 from zjffdu/ipython_version and squashes the following commits:

b4c7b42 [Jeff Zhang] HotFix: Fix IPythonInterpreter unit test


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

Branch: refs/heads/master
Commit: 3505625c26a45df14d6412b73da0b33aac68e908
Parents: 4a679fc
Author: Jeff Zhang 
Authored: Mon Dec 11 20:53:08 2017 +0800
Committer: Jeff Zhang 
Committed: Wed Dec 13 18:45:35 2017 +0800

--
 testing/install_external_dependencies.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3505625c/testing/install_external_dependencies.sh
--
diff --git a/testing/install_external_dependencies.sh 
b/testing/install_external_dependencies.sh
index daa670b..e34296e 100755
--- a/testing/install_external_dependencies.sh
+++ b/testing/install_external_dependencies.sh
@@ -44,6 +44,6 @@ if [[ -n "$PYTHON" ]] ; then
   conda update -q conda
   conda info -a
   conda config --add channels conda-forge
-  conda install -q matplotlib pandasql ipython jupyter_client ipykernel 
matplotlib bokeh=0.12.6
+  conda install -q matplotlib pandasql ipython=5.4.1 jupyter_client ipykernel 
matplotlib bokeh=0.12.6
   pip install -q grpcio ggplot
 fi