Repository: zeppelin
Updated Branches:
  refs/heads/master 2cb39f92e -> e08ddf783


ZEPPELIN-1473. It is not necessary to create SQLContext in LivyInterpreter

### What is this PR for?
Livy will create SQLContext/HiveContext internally, (LIVY-94), so it is not 
necessary to create that in LivyInterpreter. Otherwise sqlContext in zeppelin 
will override that in livy.

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

### Todos
* [ ] - Task

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

### How should this be tested?
Tested manually.  HiveContext is created properly in livy (with proper livy 
configuration), and can access hive data.

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18743886/bff7ae8e-80ed-11e6-83e6-0769c30e4094.png)

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

Author: Jeff Zhang <[email protected]>

Closes #1450 from zjffdu/ZEPPELIN-1473 and squashes the following commits:

bae46a1 [Jeff Zhang] ZEPPELIN-1473. It is not necessary to create SQLContext in 
LivyInterpreter


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

Branch: refs/heads/master
Commit: e08ddf78367b94b1fe5636d6640482486dc2326e
Parents: 2cb39f9
Author: Jeff Zhang <[email protected]>
Authored: Thu Sep 22 17:53:51 2016 +0800
Committer: Prabhjyot Singh <[email protected]>
Committed: Sat Sep 24 09:55:33 2016 +0530

----------------------------------------------------------------------
 livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java    | 6 ------
 .../java/org/apache/zeppelin/livy/LivySparkInterpreter.java    | 1 -
 .../java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java | 1 -
 3 files changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e08ddf78/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
----------------------------------------------------------------------
diff --git a/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java 
b/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
index 9a92c31..0b09e28 100644
--- a/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
+++ b/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
@@ -130,12 +130,6 @@ public class LivyHelper {
     }
   }
 
-  protected void initializeSpark(final InterpreterContext context,
-                                 final Map<String, Integer> userSessionMap) 
throws Exception {
-    interpret("val sqlContext = new org.apache.spark.sql.SQLContext(sc)\n" +
-        "import sqlContext.implicits._", context, userSessionMap);
-  }
-
   public InterpreterResult interpretInput(String stringLines,
                                           final InterpreterContext context,
                                           final Map<String, Integer> 
userSessionMap,

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e08ddf78/livy/src/main/java/org/apache/zeppelin/livy/LivySparkInterpreter.java
----------------------------------------------------------------------
diff --git 
a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkInterpreter.java 
b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkInterpreter.java
index 6aac56d..95ee22e 100644
--- a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkInterpreter.java
+++ b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkInterpreter.java
@@ -75,7 +75,6 @@ public class LivySparkInterpreter extends Interpreter {
                   interpreterContext,
                   "spark")
           );
-          livyHelper.initializeSpark(interpreterContext, userSessionMap);
         } catch (Exception e) {
           LOGGER.error("Exception in LivySparkInterpreter while interpret ", 
e);
           return new InterpreterResult(InterpreterResult.Code.ERROR, 
e.getMessage());

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e08ddf78/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java
----------------------------------------------------------------------
diff --git 
a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java 
b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java
index 22773df..3d4a0f4 100644
--- a/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java
+++ b/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java
@@ -65,7 +65,6 @@ public class LivySparkSQLInterpreter extends Interpreter {
                   interpreterContext,
                   "spark")
           );
-          livyHelper.initializeSpark(interpreterContext, userSessionMap);
         } catch (Exception e) {
           LOGGER.error("Exception in LivySparkSQLInterpreter while interpret 
", e);
           return new InterpreterResult(InterpreterResult.Code.ERROR, 
e.getMessage());

Reply via email to