address comments

This commit is contained in:
Jeff Zhang 2016-10-08 16:09:33 +08:00
parent 05a3b9b0a7
commit 39f161a36a
5 changed files with 8 additions and 16 deletions

View file

@ -74,6 +74,8 @@ dump c;
**pig.query**
```
%pig.query
b = foreach raw_data generate Category;
c = group b by Category;
foreach c generate group as category, COUNT($1) as count;

View file

@ -122,20 +122,6 @@
<scope>test</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>org.mockito</groupId>-->
<!--<artifactId>mockito-all</artifactId>-->
<!--<version>1.9.5</version>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.mockrunner</groupId>-->
<!--<artifactId>mockrunner-jdbc</artifactId>-->
<!--<version>1.0.8</version>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
</dependencies>
<build>

View file

@ -94,6 +94,7 @@ public class PigInterpreter extends BasePigInterpreter {
if (!fe.getMessage().contains("Backend error :")) {
// If the error message contains "Backend error :", that means the exception is from
// backend.
LOGGER.error("Fail to run pig script.", e);
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
}
}
@ -101,7 +102,7 @@ public class PigInterpreter extends BasePigInterpreter {
if (stats != null) {
String errorMsg = PigUtils.extactJobStats(stats);
if (errorMsg != null) {
LOGGER.debug("Error Message:" + errorMsg);
LOGGER.error("Fail to run pig script, " + errorMsg);
return new InterpreterResult(Code.ERROR, errorMsg);
}
}

View file

@ -126,6 +126,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);
return new InterpreterResult(Code.ERROR, ExceptionUtils.getStackTrace(e));
}
}

View file

@ -267,6 +267,7 @@ public class PigUtils {
}
return jobIds;
} catch (Exception e) {
LOGGER.error("Can not extract jobIds from SimpelPigStats", e);
throw new RuntimeException("Can not extract jobIds from SimpelPigStats", e);
}
}
@ -279,11 +280,12 @@ public class PigUtils {
Map<String, TezDAGStats> tezDAGStatsMap =
(Map<String, TezDAGStats>) tezDAGStatsMapField.get(stat);
for (TezDAGStats dagStats : tezDAGStatsMap.values()) {
LOGGER.info("Tez JobId:" + dagStats.getJobId());
LOGGER.debug("Tez JobId:" + dagStats.getJobId());
jobIds.add(dagStats.getJobId());
}
return jobIds;
} catch (Exception e) {
LOGGER.error("Can not extract jobIds from TezPigScriptStats", e);
throw new RuntimeException("Can not extract jobIds from TezPigScriptStats", e);
}
}