本文整理汇总了Java中org.apache.pig.PigException.BUG属性的典型用法代码示例。如果您正苦于以下问题:Java PigException.BUG属性的具体用法?Java PigException.BUG怎么用?Java PigException.BUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.pig.PigException
的用法示例。
在下文中一共展示了PigException.BUG属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: accumulate
@Override
public void accumulate(Tuple b) throws IOException {
try {
DateTime curMax = max(b);
if (curMax == null) {
return;
}
// check curMax
if (intermediateMax == null || curMax.isAfter(intermediateMax)) {
intermediateMax = curMax;
}
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
String msg = "Error while computing max in " + this.getClass().getSimpleName();
throw new ExecException(msg, errCode, PigException.BUG, e);
}
}
示例2: MRCompiler
public MRCompiler(PhysicalPlan plan,
PigContext pigContext) throws MRCompilerException {
super(plan, new DepthFirstWalker<PhysicalOperator, PhysicalPlan>(plan));
this.plan = plan;
this.pigContext = pigContext;
splitsSeen = new HashMap<OperatorKey, MapReduceOper>();
MRPlan = new MROperPlan();
nig = NodeIdGenerator.getGenerator();
udfFinder = new UDFFinder();
List<PhysicalOperator> roots = plan.getRoots();
if((roots == null) || (roots.size() <= 0)) {
int errCode = 2053;
String msg = "Internal error. Did not find roots in the physical plan.";
throw new MRCompilerException(msg, errCode, PigException.BUG);
}
scope = roots.get(0).getOperatorKey().getScope();
messageCollector = new CompilationMessageCollector() ;
phyToMROpMap = new HashMap<PhysicalOperator, MapReduceOper>();
fileConcatenationThreshold = Integer.parseInt(pigContext.getProperties()
.getProperty(FILE_CONCATENATION_THRESHOLD, "100"));
optimisticFileConcatenation = pigContext.getProperties().getProperty(
OPTIMISTIC_FILE_CONCATENATION, "false").equals("true");
LOG.info("File concatenation threshold: " + fileConcatenationThreshold
+ " optimistic? " + optimisticFileConcatenation);
}
示例3: exec
@Override
public Tuple exec(Tuple input) throws IOException {
try {
DataBag b = (DataBag)input.get(0);
return combine(b);
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
String msg = "Error while computing average in " + this.getClass().getSimpleName();
throw new ExecException(msg, errCode, PigException.BUG, e);
}
}
示例4: nonBlocking
private void nonBlocking(PhysicalOperator op) throws PlanException, IOException {
TezOperator tezOp;
if (compiledInputs.length == 1) {
tezOp = compiledInputs[0];
if (tezOp.isClosed()) {
int errCode = 2027;
String msg = "Tez operator has been closed. This is unexpected for a merge.";
throw new PlanException(msg, errCode, PigException.BUG);
}
} else {
tezOp = merge(compiledInputs);
}
tezOp.plan.addAsLeaf(op);
curTezOp = tezOp;
}
示例5: processOnePackageOutput
public boolean processOnePackageOutput(ICollector collector) throws ExecException {
Result res = pack.getNextTuple();
if(res.returnStatus==POStatus.STATUS_OK){
Tuple packRes = (Tuple)res.result;
if(leaf == null || reducePlan.isEmpty()){
collector.emit(new FValues(null, packRes));
return false;
}
for (int i = 0; i < roots.length; i++) {
roots[i].attachInput(packRes);
}
runPipeline(leaf, collector);
}
if(res.returnStatus==POStatus.STATUS_NULL) {
return false;
}
if(res.returnStatus==POStatus.STATUS_ERR){
int errCode = 2093;
String msg = "Encountered error in package operator while processing group.";
throw new ExecException(msg, errCode, PigException.BUG);
}
if(res.returnStatus==POStatus.STATUS_EOP) {
return true;
}
return false;
}
示例6: visit
@Override
public void visit( BinCondExpression op ) throws FrontendException {
POBinCond exprOp = new POBinCond( new OperatorKey(DEFAULT_SCOPE,
nodeGen.getNextNodeId(DEFAULT_SCOPE)) );
exprOp.setResultType(op.getType());
exprOp.setCond((ExpressionOperator) logToPhyMap.get(op.getCondition()));
exprOp.setLhs((ExpressionOperator) logToPhyMap.get(op.getLhs()));
exprOp.setRhs((ExpressionOperator) logToPhyMap.get(op.getRhs()));
OperatorPlan oPlan = op.getPlan();
currentPlan.add(exprOp);
logToPhyMap.put(op, exprOp);
List<Operator> successors = oPlan.getSuccessors(op);
if (successors == null) {
return;
}
for (Operator lo : successors) {
PhysicalOperator from = logToPhyMap.get(lo);
try {
currentPlan.connect(from, exprOp);
} catch (PlanException e) {
int errCode = 2015;
String msg = "Invalid physical operators in the physical plan" ;
throw new LogicalToPhysicalTranslatorException(msg, errCode, PigException.BUG, e);
}
}
}
示例7: exec
@Override
public Long exec(Tuple input) throws IOException {
try {
return doTupleWork(input, this);
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
throw new ExecException("Error executing function on Longs", errCode, PigException.BUG, e);
}
}
示例8: exec
@Override
public Tuple exec(Tuple input) throws IOException {
try {
Tuple t = mTupleFactory.newTuple(2);
// input is a bag with one tuple containing
// the column we are trying to avg on
DataBag bg = (DataBag) input.get(0);
BigDecimal d = null;
if (bg.iterator().hasNext()) {
Tuple tp = bg.iterator().next();
d = (BigDecimal)(tp.get(0));
}
t.set(0, d);
if (d != null) {
t.set(1, BigDecimal.ONE);
} else {
t.set(1, BigDecimal.ZERO);
}
return t;
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
String msg = "Error while computing average in " + this.getClass().getSimpleName();
throw new ExecException(msg, errCode, PigException.BUG, e);
}
}
示例9: visitSplit
@Override
public void visitSplit(POSplit op) throws VisitorException {
try {
TezOperator splitOp = curTezOp;
POValueOutputTez output = null;
if (splitsSeen.containsKey(op.getOperatorKey())) {
splitOp = splitsSeen.get(op.getOperatorKey());
output = (POValueOutputTez)splitOp.plan.getLeaves().get(0);
} else {
splitsSeen.put(op.getOperatorKey(), splitOp);
splitOp.setSplitter(true);
phyToTezOpMap.put(op, splitOp);
output = new POValueOutputTez(OperatorKey.genOpKey(scope));
output.copyAliasFrom(op);
splitOp.plan.addAsLeaf(output);
}
curTezOp = getTezOp();
curTezOp.setSplitParent(splitOp.getOperatorKey());
tezPlan.add(curTezOp);
output.addOutputKey(curTezOp.getOperatorKey().toString());
TezEdgeDescriptor edge = TezCompilerUtil.connect(tezPlan, splitOp, curTezOp);
//TODO shared edge once support is available in Tez
TezCompilerUtil.configureValueOnlyTupleOutput(edge, DataMovementType.ONE_TO_ONE);
curTezOp.setRequestedParallelismByReference(splitOp);
POValueInputTez input = new POValueInputTez(OperatorKey.genOpKey(scope));
input.copyAliasFrom(op);
input.setInputKey(splitOp.getOperatorKey().toString());
curTezOp.plan.addAsLeaf(input);
} catch (Exception e) {
int errCode = 2034;
String msg = "Error compiling operator "
+ op.getClass().getSimpleName();
throw new TezCompilerException(msg, errCode, PigException.BUG, e);
}
}
示例10: visitLocalRearrange
@Override
public void visitLocalRearrange(POLocalRearrange lrearrange) throws VisitorException {
loRearrangeFound++;
Map<Integer,Pair<Boolean, Map<Integer, Integer>>> keyInfo;
if (pkg instanceof POPackageLite) {
if(lrearrange.getIndex() != 0) {
// Throw some exception here
throw new RuntimeException("POLocalRearrange for POPackageLite cannot have index other than 0, but has index - "+lrearrange.getIndex());
}
}
// annotate the package with information from the LORearrange
// update the keyInfo information if already present in the POPackage
keyInfo = pkg.getKeyInfo();
if(keyInfo == null)
keyInfo = new HashMap<Integer, Pair<Boolean, Map<Integer, Integer>>>();
if(keyInfo.get(Integer.valueOf(lrearrange.getIndex())) != null) {
// something is wrong - we should not be getting key info
// for the same index from two different Local Rearranges
int errCode = 2087;
String msg = "Unexpected problem during optimization." +
" Found index:" + lrearrange.getIndex() +
" in multiple LocalRearrange operators.";
throw new OptimizerException(msg, errCode, PigException.BUG);
}
keyInfo.put(Integer.valueOf(lrearrange.getIndex()),
new Pair<Boolean, Map<Integer, Integer>>(
lrearrange.isProjectStar(), lrearrange.getProjectedColsMap()));
pkg.setKeyInfo(keyInfo);
pkg.setKeyTuple(lrearrange.isKeyTuple());
pkg.setKeyCompound(lrearrange.isKeyCompound());
}
示例11: visitLoad
@Override
public void visitLoad(POLoad op) throws VisitorException {
try {
nonBlocking(op);
curTezOp.setUseMRMapSettings(true);
phyToTezOpMap.put(op, curTezOp);
} catch (Exception e) {
int errCode = 2034;
String msg = "Error compiling operator " + op.getClass().getSimpleName();
throw new TezCompilerException(msg, errCode, PigException.BUG, e);
}
}
示例12: throwProcessingException
public void throwProcessingException (boolean withCauseException, Exception e) throws ExecException {
int errCode = 2176;
String errMsg = "Error processing right input during merge join";
if(withCauseException) {
throw new ExecException(errMsg, errCode, PigException.BUG, e);
} else {
throw new ExecException(errMsg, errCode, PigException.BUG);
}
}
示例13: exec
@Override
public String exec(Tuple input) throws IOException {
try {
return max(input);
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
String msg = "Error while computing max in " + this.getClass().getSimpleName();
throw new ExecException(msg, errCode, PigException.BUG, e);
}
}
示例14: exec
@Override
public Long exec(Tuple input) throws IOException {
try {
DataBag bag = (DataBag)input.get(0);
return bag.size();
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
String msg = "Error while computing count in " + this.getClass().getSimpleName();
throw new ExecException(msg, errCode, PigException.BUG, e);
}
}
示例15: exec
@Override
public Integer exec(Tuple input) throws IOException {
try {
return doTupleWork(input, this);
} catch (ExecException ee) {
throw ee;
} catch (Exception e) {
int errCode = 2106;
throw new ExecException("Error executing function ", errCode, PigException.BUG, e);
}
}