Source:
<code>public InterpreterResult interpret(String st, InterpreterContext context) { SQLContext sqlc = null; SparkInterpreter sparkInterpreter = getSparkInterpreter(); if (sparkInterpreter.isUnsupportedSparkVersion()) { return new InterpreterResult(Code.ERROR, "Spark " + sparkInterpreter.getSparkVersion().toString() + " is not supported"); } sparkInterpreter.populateSparkWebUrl(context); sparkInterpreter.getZeppelinContext().setInterpreterContext(context); sqlc = sparkInterpreter.getSQLContext(); SparkContext sc = sqlc.sparkContext(); if (concurrentSQL()) { sc.setLocalProperty("spark.scheduler.pool", "fair"); } else { sc.setLocalProperty("spark.scheduler.pool", null); } String jobDesc = "Started by: " + Utils.getUserName(context.getAuthenticationInfo()); sc.setJobGroup(Utils.buildJobGroupId(context), jobDesc, false); Object rdd = null; try { Method sqlMethod = sqlc.getClass().getMethod("sql", String.class); String interpolateResult = interpolateVariable(st); <START> if (interpolateResult.startsWith("ERROR:")) <END> return new InterpreterResult(Code.ERROR, interpolateResult.substring("ERROR:".length())); else rdd = sqlMethod.invoke(sqlc, interpolateResult); } catch (InvocationTargetException ite) { if (Boolean.parseBoolean(getProperty("zeppelin.spark.sql.stacktrace"))) { throw new InterpreterException(ite); } logger.error("Invocation target exception", ite); String msg = ite.getTargetException().getMessage() + "\nset zeppelin.spark.sql.stacktrace = true to see full stacktrace"; return new InterpreterResult(Code.ERROR, msg); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException e) { throw new InterpreterException(e); } String msg = sparkInterpreter.getZeppelinContext().showData(rdd); sc.clearJobGroup(); return new InterpreterResult(Code.SUCCESS, msg); }</code><technical_language>a String status return is a bit odd, returning a bool result separately</technical_language>

Target:
public InterpreterResult interpret(String st, InterpreterContext context) { SparkZeppelinContext sparkZeppelinContext = getSparkInterpreter().getZeppelinContext(); String interpolatedCommand = interpolateZeppelinContextObjects(st, sparkZeppelinContext); SQLContext sqlc = null; SparkInterpreter sparkInterpreter = getSparkInterpreter(); if (sparkInterpreter.isUnsupportedSparkVersion()) { return new InterpreterResult(Code.ERROR, "Spark " + sparkInterpreter.getSparkVersion().toString() + " is not supported"); } sparkInterpreter.populateSparkWebUrl(context); sparkInterpreter.getZeppelinContext().setInterpreterContext(context); sqlc = sparkInterpreter.getSQLContext(); SparkContext sc = sqlc.sparkContext(); if (concurrentSQL()) { sc.setLocalProperty("spark.scheduler.pool", "fair"); } else { sc.setLocalProperty("spark.scheduler.pool", null); } String jobDesc = "Started by: " + Utils.getUserName(context.getAuthenticationInfo()); sc.setJobGroup(Utils.buildJobGroupId(context), jobDesc, false); Object rdd = null; try { Method sqlMethod = sqlc.getClass().getMethod("sql", String.class); rdd = sqlMethod.invoke(sqlc, interpolatedCommand); } catch (InvocationTargetException ite) { if (Boolean.parseBoolean(getProperty("zeppelin.spark.sql.stacktrace"))) { throw new InterpreterException(ite); } logger.error("Invocation target exception", ite); String msg = ite.getTargetException().getMessage() + "\nset zeppelin.spark.sql.stacktrace = true to see full stacktrace"; return new InterpreterResult(Code.ERROR, msg); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException e) { throw new InterpreterException(e); } String msg = sparkInterpreter.getZeppelinContext().showData(rdd); sc.clearJobGroup(); return new InterpreterResult(Code.SUCCESS, msg); }