try {
pigContext.getProperties().setProperty( PigContext.JOB_NAME, jobName );
if( jobPriority != null ) {
pigContext.getProperties().setProperty( PigContext.JOB_PRIORITY, jobPriority );
}
ExecJob job = store(id, FileLocalizer.getTemporaryPath(pigContext)
.toString(), Utils.getTmpFileCompressorName(pigContext)
+ "()");
// invocation of "execute" is synchronous!
if (job.getStatus() == JOB_STATUS.COMPLETED) {
return job.getResults();
} else if (job.getStatus() == JOB_STATUS.FAILED
&& job.getException() != null) {
// throw the backend exception in the failed case
Exception e = job.getException();
int errCode = 1066;
String msg = "Unable to open iterator for alias " + id
+ ". Backend error : " + e.getMessage();
throw new FrontendException(msg, errCode, PigException.INPUT, e);
} else {
throw new IOException("Job terminated with anomalous status "
+ job.getStatus().toString());
}
} catch (FrontendException e) {
throw e;
} catch (Exception e) {
int errCode = 1066;