mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
working spark sql
This commit is contained in:
parent
de2fd3cd60
commit
ee2dcebe35
2 changed files with 9 additions and 2 deletions
|
|
@ -171,9 +171,13 @@ public class LivyHelper {
|
|||
final Map<String, Integer> userSessionMap)
|
||||
throws Exception {
|
||||
stringLines = stringLines
|
||||
//for "\n" present in string
|
||||
.replaceAll("\\\\n", "\\\\\\\\n")
|
||||
//for new line present in string
|
||||
.replaceAll("\\n", "\\\\n")
|
||||
// for \" present in string
|
||||
.replaceAll("\\\\\"", "\\\\\\\\\"")
|
||||
// for " present in string
|
||||
.replaceAll("\"", "\\\\\"");
|
||||
|
||||
if (stringLines.trim().equals("")) {
|
||||
|
|
|
|||
|
|
@ -87,8 +87,11 @@ public class LivySparkSQLInterpreter extends Interpreter {
|
|||
return new InterpreterResult(InterpreterResult.Code.SUCCESS, "");
|
||||
}
|
||||
|
||||
InterpreterResult res = livyHelper.interpret("sqlContext.sql(\"" + line + "\").show("
|
||||
+ property.get("livy.spark.maxResult") + ")",
|
||||
InterpreterResult res = livyHelper.interpret("sqlContext.sql(\"" +
|
||||
line.replaceAll("\"", "\\\\\"")
|
||||
.replaceAll("\\n", " ")
|
||||
+ "\").show(" +
|
||||
property.get("livy.spark.maxResult") + ")",
|
||||
interpreterContext, userSessionMap);
|
||||
|
||||
if (res.code() == InterpreterResult.Code.SUCCESS) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue