Skip to content

Commit 39f161a

Browse files
committed
address comments
1 parent 05a3b9b commit 39f161a

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

docs/interpreter/pig.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ dump c;
7474

7575
**pig.query**
7676
```
77+
%pig.query
78+
7779
b = foreach raw_data generate Category;
7880
c = group b by Category;
7981
foreach c generate group as category, COUNT($1) as count;

pig/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,6 @@
122122
<scope>test</scope>
123123
</dependency>
124124

125-
<!--<dependency>-->
126-
<!--<groupId>org.mockito</groupId>-->
127-
<!--<artifactId>mockito-all</artifactId>-->
128-
<!--<version>1.9.5</version>-->
129-
<!--<scope>test</scope>-->
130-
<!--</dependency>-->
131-
132-
<!--<dependency>-->
133-
<!--<groupId>com.mockrunner</groupId>-->
134-
<!--<artifactId>mockrunner-jdbc</artifactId>-->
135-
<!--<version>1.0.8</version>-->
136-
<!--<scope>test</scope>-->
137-
<!--</dependency>-->
138-
139125
</dependencies>
140126

141127
<build>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr
9494
if (!fe.getMessage().contains("Backend error :")) {
9595
// If the error message contains "Backend error :", that means the exception is from
9696
// backend.
97+
LOGGER.error("Fail to run pig script.", e);
9798
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
9899
}
99100
}
100101
PigStats stats = PigStats.get();
101102
if (stats != null) {
102103
String errorMsg = PigUtils.extactJobStats(stats);
103104
if (errorMsg != null) {
104-
LOGGER.debug("Error Message:" + errorMsg);
105+
LOGGER.error("Fail to run pig script, " + errorMsg);
105106
return new InterpreterResult(Code.ERROR, errorMsg);
106107
}
107108
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public InterpreterResult interpret(String st, InterpreterContext context) {
126126
if (e instanceof FrontendException) {
127127
FrontendException fe = (FrontendException) e;
128128
if (!fe.getMessage().contains("Backend error :")) {
129+
LOGGER.error("Fail to run pig script.", e);
129130
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
130131
}
131132
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ public static List<String> extractJobIdsFromSimplePigStats(SimplePigStats stat)
267267
}
268268
return jobIds;
269269
} catch (Exception e) {
270+
LOGGER.error("Can not extract jobIds from SimpelPigStats", e);
270271
throw new RuntimeException("Can not extract jobIds from SimpelPigStats", e);
271272
}
272273
}
@@ -279,11 +280,12 @@ public static List<String> extractJobIdsFromTezPigStats(TezPigScriptStats stat)
279280
Map<String, TezDAGStats> tezDAGStatsMap =
280281
(Map<String, TezDAGStats>) tezDAGStatsMapField.get(stat);
281282
for (TezDAGStats dagStats : tezDAGStatsMap.values()) {
282-
LOGGER.info("Tez JobId:" + dagStats.getJobId());
283+
LOGGER.debug("Tez JobId:" + dagStats.getJobId());
283284
jobIds.add(dagStats.getJobId());
284285
}
285286
return jobIds;
286287
} catch (Exception e) {
288+
LOGGER.error("Can not extract jobIds from TezPigScriptStats", e);
287289
throw new RuntimeException("Can not extract jobIds from TezPigScriptStats", e);
288290
}
289291
}

0 commit comments

Comments
 (0)