mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
address comments
This commit is contained in:
parent
c85a09031a
commit
e858301bdf
4 changed files with 14 additions and 9 deletions
|
|
@ -164,9 +164,13 @@ elif [[ "${INTERPRETER_ID}" == "pig" ]]; then
|
|||
fi
|
||||
|
||||
# autodetect TEZ_CONF_DIR
|
||||
TEZ_CONF_DIR = ${TEZ_CONF_DIR:=/etc/tez/conf}
|
||||
echo "TEZ_CONF_DIR:${TEZ_CONF_DIR}"
|
||||
ZEPPELIN_INTP_CLASSPATH+=":${TEZ_CONF_DIR}"
|
||||
if [[ -n "${TEZ_CONF_DIR}" ]]; then
|
||||
ZEPPELIN_INTP_CLASSPATH+=":${TEZ_CONF_DIR}"
|
||||
elif [[ -d "/etc/tez/conf" ]]; then
|
||||
ZEPPELIN_INTP_CLASSPATH+=":/etc/tez/conf"
|
||||
else
|
||||
echo "TEZ_CONF_DIR is not set, configuration might not be loaded"
|
||||
fi
|
||||
fi
|
||||
|
||||
addJarInDirForIntp "${LOCAL_INTERPRETER_REPO}"
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ public class PigInterpreter extends BasePigInterpreter {
|
|||
try {
|
||||
pigServer = new PigServer(execType);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Fail to launch PigServer", e);
|
||||
LOGGER.error("Fail to initialize PigServer", e);
|
||||
throw new RuntimeException("Fail to initialize PigServer", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,6 +107,7 @@ public class PigInterpreter extends BasePigInterpreter {
|
|||
return new InterpreterResult(Code.ERROR, errorMsg);
|
||||
}
|
||||
}
|
||||
LOGGER.error("Fail to run pig script.", e);
|
||||
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
|
||||
} finally {
|
||||
System.setOut(originalStdOut);
|
||||
|
|
@ -122,9 +124,6 @@ public class PigInterpreter extends BasePigInterpreter {
|
|||
outputBuilder.append(jobStats);
|
||||
}
|
||||
}
|
||||
if (!outputBuilder.toString().isEmpty() || !bytesOutput.toString().isEmpty()) {
|
||||
outputBuilder.append("------------- Pig Output --------------\n");
|
||||
}
|
||||
outputBuilder.append(bytesOutput.toString());
|
||||
return new InterpreterResult(Code.SUCCESS, outputBuilder.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public class PigQueryInterpreter extends BasePigInterpreter {
|
|||
|
||||
@Override
|
||||
public InterpreterResult interpret(String st, InterpreterContext context) {
|
||||
// '-' is invalid for pig alias
|
||||
String alias = "paragraph_" + context.getParagraphId().replace("-", "_");
|
||||
String[] lines = st.split("\n");
|
||||
List<String> queries = new ArrayList<String>();
|
||||
|
|
@ -126,7 +127,7 @@ public class PigQueryInterpreter extends BasePigInterpreter {
|
|||
if (e instanceof FrontendException) {
|
||||
FrontendException fe = (FrontendException) e;
|
||||
if (!fe.getMessage().contains("Backend error :")) {
|
||||
LOGGER.error("Fail to run pig script.", e);
|
||||
LOGGER.error("Fail to run pig query.", e);
|
||||
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
}
|
||||
|
|
@ -137,6 +138,7 @@ public class PigQueryInterpreter extends BasePigInterpreter {
|
|||
return new InterpreterResult(Code.ERROR, errorMsg);
|
||||
}
|
||||
}
|
||||
LOGGER.error("Fail to run pig query.", e);
|
||||
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
|
||||
} finally {
|
||||
listenerMap.remove(context.getParagraphId());
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
"zeppelin.pig.maxResult": {
|
||||
"envName": null,
|
||||
"propertyName": "zeppelin.pig.maxResult",
|
||||
"defaultValue": "20",
|
||||
"defaultValue": "1000",
|
||||
"description": "max row number for %pig.query"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue