Package org.apache.pig.impl.plan

Examples of org.apache.pig.impl.plan.VisitorException


                secondaryPlanList.add(secondaryPlan);
            }
            rearrange.setSecondaryPlans(secondaryPlanList);
        } catch (PlanException e) {
            int errorCode = 2204;
            throw new VisitorException("Error setting secondary key plan",
                    errorCode, e);
        }
    }
View Full Code Here


                }
                if(seen.size() > 1) {
                    // throw exception since we should get the same key type from all predecessors
                    int errorCode = 2119;
                    String message = "Internal Error: Found multiple data types for map key";
                    throw new VisitorException(message, errorCode, PigException.BUG);
                }
                // if we were not able to find the key and
                // if there is a map and reduce phase, then the
                // map would need to send a valid key object and this
                // can be an issue when the key is null - so error out here!
                // if the reduce phase is empty, then this is a map only job
                // which will not need a key object -
                // IMPORTANT NOTE: THIS RELIES ON THE FACT THAT CURRENTLY
                // IN PigMapOnly.collect(), null IS SENT IN THE collect() CALL
                // FOR THE KEY - IF THAT CHANGES, THEN THIS CODE HERE MAY NEED TO
                // CHANGE!
                if(!foundKeyType && !mr.reducePlan.isEmpty()) {
                    // throw exception since we were not able to determine key type!
                    int errorCode = 2120;
                    String message = "Internal Error: Unable to determine data type for map key";
                    throw new VisitorException(message, errorCode, PigException.BUG);
                }
            }
        }
    }
View Full Code Here

        try {
            finisher.visit();
        } catch (VisitorException e) {
            int errCode = 2121;
            String msg = "Error while calling finish method on UDFs.";
            throw new VisitorException(msg, errCode, PigException.BUG, e);
        }
       
        mp = null;

        PhysicalOperator.setReporter(null);
View Full Code Here

            List<PhysicalOperator> ls = mr.reducePlan.getLeaves();
            for(PhysicalOperator op: ls) {
              scan(mr, op, fs.getFileName());
            }       
        } catch (PlanException e) {
            throw new VisitorException(e);
        }

        // Second, replace the loader in our successor with whatever the originally used loader was.
        fs = new FileSpec(predFs.getFileName(), predFs.getFuncSpec());
        newLoad = new POLoad(succLoad.getOperatorKey(), succLoad.getRequestedParallelism(), fs);
        newLoad.setSignature(predLoad.getSignature());
        try {
            succ.mapPlan.replace(succLoad, newLoad);
            // Add the loader's funcspec to the list of udf's associated with this mr operator
            succ.UDFs.add(newLoad.getLFile().getFuncSpec().toString());
        } catch (PlanException e) {
            throw new VisitorException(e);
        }

        // Cannot delete the pred right now, because we are still traversing the graph. So, mark the pred and remove it from the
        // plan once the visit by this optimizer is complete.
        opsToRemove.add(pred);
View Full Code Here

            if (cnst.getRequestedParallelism() == -1) {
                Object obj = cnst.getValue();
                if (obj instanceof Integer) {
                    if (replaced) {
                        // sample job should have only one ConstantExpression
                        throw new VisitorException("Invalid reduce plan: more " +
                            "than one ConstantExpression found in sampling job");
                    }
                    cnst.setValue(rp);                   
                    cnst.setRequestedParallelism(rp);
                    replaced = true;
View Full Code Here

            List<PhysicalOperator> ls = mr.reducePlan.getLeaves();
            for(PhysicalOperator op: ls) {
              scan(mr, op, fs.getFileName());
            }       
        } catch (PlanException e) {
            throw new VisitorException(e);
        }

        // Second, replace the loader in our successor with whatever the originally used loader was.
        fs = new FileSpec(predFs.getFileName(), predFs.getFuncSpec());
        newLoad = new POLoad(succLoad.getOperatorKey(), succLoad.getRequestedParallelism(), fs);
        newLoad.setSignature(predLoad.getSignature());
        try {
            succ.mapPlan.replace(succLoad, newLoad);
        } catch (PlanException e) {
            throw new VisitorException(e);
        }

        // Cannot delete the pred right now, because we are still traversing the graph. So, mark the pred and remove it from the
        // plan once the visit by this optimizer is complete.
        opsToRemove.add(pred);
View Full Code Here

                }
                if(seen.size() > 1) {
                    // throw exception since we should get the same key type from all predecessors
                    int errorCode = 2119;
                    String message = "Internal Error: Found multiple data types for map key";
                    throw new VisitorException(message, errorCode, PigException.BUG);
                }
                // if we were not able to find the key and
                // if there is a map and reduce phase, then the
                // map would need to send a valid key object and this
                // can be an issue when the key is null - so error out here!
                // if the reduce phase is empty, then this is a map only job
                // which will not need a key object -
                // IMPORTANT NOTE: THIS RELIES ON THE FACT THAT CURRENTLY
                // IN PigMapOnly.collect(), null IS SENT IN THE collect() CALL
                // FOR THE KEY - IF THAT CHANGES, THEN THIS CODE HERE MAY NEED TO
                // CHANGE!
                if(!foundKeyType && !mr.reducePlan.isEmpty()) {
                    // throw exception since we were not able to determine key type!
                    int errorCode = 2120;
                    String message = "Internal Error: Unable to determine data type for map key";
                    throw new VisitorException(message, errorCode, PigException.BUG);
                }
            }
        }
    }
View Full Code Here

        try {
            finisher.visit();
        } catch (VisitorException e) {
            int errCode = 2121;
            String msg = "Error while calling finish method on UDFs.";
            throw new VisitorException(msg, errCode, PigException.BUG, e);
        }
       
        mp = null;

        PhysicalOperator.setReporter(null);
View Full Code Here

            String msg = "Invalid physical operators in the physical plan" ;
            throw new LogicalToPhysicalTranslatorException(msg, errCode, PigException.BUG, e1);
        } catch (ExecException e) {
          int errCode = 2058;
          String msg = "Unable to set index on newly create POLocalRearrange.";
            throw new VisitorException(msg, errCode, PigException.BUG, e);
        }
       
        poPackage.setKeyType(DataType.TUPLE);
        poPackage.setResultType(DataType.TUPLE);
        poPackage.setNumInps(count);
View Full Code Here

            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                int errCode = 2058;
                String msg = "Unable to set index on newly create POLocalRearrange.";
                throw new VisitorException(msg, errCode, PigException.BUG, e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.plan.VisitorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.