Skip to content

Commit e858301

Browse files
committed
address comments
1 parent c85a090 commit e858301

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

bin/interpreter.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,13 @@ elif [[ "${INTERPRETER_ID}" == "pig" ]]; then
164164
fi
165165

166166
# autodetect TEZ_CONF_DIR
167-
TEZ_CONF_DIR = ${TEZ_CONF_DIR:=/etc/tez/conf}
168-
echo "TEZ_CONF_DIR:${TEZ_CONF_DIR}"
169-
ZEPPELIN_INTP_CLASSPATH+=":${TEZ_CONF_DIR}"
167+
if [[ -n "${TEZ_CONF_DIR}" ]]; then
168+
ZEPPELIN_INTP_CLASSPATH+=":${TEZ_CONF_DIR}"
169+
elif [[ -d "/etc/tez/conf" ]]; then
170+
ZEPPELIN_INTP_CLASSPATH+=":/etc/tez/conf"
171+
else
172+
echo "TEZ_CONF_DIR is not set, configuration might not be loaded"
173+
fi
170174
fi
171175

172176
addJarInDirForIntp "${LOCAL_INTERPRETER_REPO}"

pig/src/main/java/org/apache/zeppelin/pig/PigInterpreter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public void open() {
5959
try {
6060
pigServer = new PigServer(execType);
6161
} catch (IOException e) {
62-
throw new RuntimeException("Fail to launch PigServer", e);
62+
LOGGER.error("Fail to initialize PigServer", e);
63+
throw new RuntimeException("Fail to initialize PigServer", e);
6364
}
6465
}
6566

@@ -106,6 +107,7 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr
106107
return new InterpreterResult(Code.ERROR, errorMsg);
107108
}
108109
}
110+
LOGGER.error("Fail to run pig script.", e);
109111
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
110112
} finally {
111113
System.setOut(originalStdOut);
@@ -122,9 +124,6 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr
122124
outputBuilder.append(jobStats);
123125
}
124126
}
125-
if (!outputBuilder.toString().isEmpty() || !bytesOutput.toString().isEmpty()) {
126-
outputBuilder.append("------------- Pig Output --------------\n");
127-
}
128127
outputBuilder.append(bytesOutput.toString());
129128
return new InterpreterResult(Code.SUCCESS, outputBuilder.toString());
130129
}

pig/src/main/java/org/apache/zeppelin/pig/PigQueryInterpreter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public void close() {
6565

6666
@Override
6767
public InterpreterResult interpret(String st, InterpreterContext context) {
68+
// '-' is invalid for pig alias
6869
String alias = "paragraph_" + context.getParagraphId().replace("-", "_");
6970
String[] lines = st.split("\n");
7071
List<String> queries = new ArrayList<String>();
@@ -126,7 +127,7 @@ public InterpreterResult interpret(String st, InterpreterContext context) {
126127
if (e instanceof FrontendException) {
127128
FrontendException fe = (FrontendException) e;
128129
if (!fe.getMessage().contains("Backend error :")) {
129-
LOGGER.error("Fail to run pig script.", e);
130+
LOGGER.error("Fail to run pig query.", e);
130131
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
131132
}
132133
}
@@ -137,6 +138,7 @@ public InterpreterResult interpret(String st, InterpreterContext context) {
137138
return new InterpreterResult(Code.ERROR, errorMsg);
138139
}
139140
}
141+
LOGGER.error("Fail to run pig query.", e);
140142
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
141143
} finally {
142144
listenerMap.remove(context.getParagraphId());

pig/src/main/resources/interpreter-setting.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"zeppelin.pig.maxResult": {
3636
"envName": null,
3737
"propertyName": "zeppelin.pig.maxResult",
38-
"defaultValue": "20",
38+
"defaultValue": "1000",
3939
"description": "max row number for %pig.query"
4040
}
4141
},

0 commit comments

Comments
 (0)