Skip to content

Commit e08ddf7

Browse files
zjffduprabhjyotsingh
authored andcommitted
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
1 parent 2cb39f9 commit e08ddf7

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ public Integer createSession(InterpreterContext context, String kind) throws Exc
130130
}
131131
}
132132

133-
protected void initializeSpark(final InterpreterContext context,
134-
final Map<String, Integer> userSessionMap) throws Exception {
135-
interpret("val sqlContext = new org.apache.spark.sql.SQLContext(sc)\n" +
136-
"import sqlContext.implicits._", context, userSessionMap);
137-
}
138-
139133
public InterpreterResult interpretInput(String stringLines,
140134
final InterpreterContext context,
141135
final Map<String, Integer> userSessionMap,

livy/src/main/java/org/apache/zeppelin/livy/LivySparkInterpreter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public InterpreterResult interpret(String line, InterpreterContext interpreterCo
7575
interpreterContext,
7676
"spark")
7777
);
78-
livyHelper.initializeSpark(interpreterContext, userSessionMap);
7978
} catch (Exception e) {
8079
LOGGER.error("Exception in LivySparkInterpreter while interpret ", e);
8180
return new InterpreterResult(InterpreterResult.Code.ERROR, e.getMessage());

livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public InterpreterResult interpret(String line, InterpreterContext interpreterCo
6565
interpreterContext,
6666
"spark")
6767
);
68-
livyHelper.initializeSpark(interpreterContext, userSessionMap);
6968
} catch (Exception e) {
7069
LOGGER.error("Exception in LivySparkSQLInterpreter while interpret ", e);
7170
return new InterpreterResult(InterpreterResult.Code.ERROR, e.getMessage());

0 commit comments

Comments
 (0)