Package org.apache.pig.impl.plan

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


                    FuncSpec funcSpec = new FuncSpec(InterStorage.class.getName());
                    FileSpec fileSpec;
                    try {
                        fileSpec = new FileSpec( FileLocalizer.getTemporaryPath( pigContext ).toString(), funcSpec );                    // TODO: need to hookup the pigcontext.
                    } catch (IOException e) {
                        throw new PlanValidationException( expr, "Failed to process scalar" + e);
                    }
                    StoreFuncInterface stoFunc = (StoreFuncInterface)PigContext.instantiateFuncFromSpec(funcSpec);
                    String sig = LogicalPlanBuilder.newOperatorKey(scope);
                    stoFunc.setStoreFuncUDFContextSignature(sig);
                    store = new LOStore(lp, fileSpec, stoFunc, sig);
View Full Code Here


                endAlias = null;
            }
            if(startCol < 0){
                String msg = "Invalid start column position in " +
                "range projection (..) " + startCol;
                throw new PlanValidationException(this, msg, 2270, PigException.BUG);
            }

            if(endCol > 0 && startCol > endCol){
                String msg = "start column appears after end column in " +
                "range projection (..) . Start column position " + startCol +
                " End column position " + endCol;
                throw new PlanValidationException(this, msg, 1127, PigException.INPUT);
            }
        }else{
            setColNum(findColNum(alias));
        }
    }
View Full Code Here

            if( colNum == -1 ) {
              String msg = "Invalid field projection. Projected field [" + alias + "] does not exist";
                if( inputSchema != null )
                  msg += " in schema: " + inputSchema.toString( false );
                msg += ".";
                throw new PlanValidationException( this, msg, 1025 );
            }
            return colNum;
        } else {
            int col = getColNum();
            if( inputSchema != null && col >= inputSchema.size() ) {
                throw new PlanValidationException( this,
                        "Out of bound access. Trying to access non-existent column: " +
                        col + ". Schema " +  inputSchema.toString(false) +
                        " has " + inputSchema.size() + " column(s)." , 1000);
            }
            return col;
View Full Code Here

                if( store == null ) {
                    FileSpec fileSpec;
                    try {
                        fileSpec = new FileSpec( FileLocalizer.getTemporaryPath( pigContext ).toString(), interStorageFuncSpec );                    // TODO: need to hookup the pigcontext.
                    } catch (IOException e) {
                        throw new PlanValidationException( expr, "Failed to process scalar" + e);
                    }
                    StoreFuncInterface stoFunc = (StoreFuncInterface)PigContext.instantiateFuncFromSpec(interStorageFuncSpec);
                    String sig = LogicalPlanBuilder.newOperatorKey(scope);
                    stoFunc.setStoreFuncUDFContextSignature(sig);
                    store = new LOStore(lp, fileSpec, stoFunc, sig);
View Full Code Here

                endAlias = null;
            }
            if(startCol < 0){
                String msg = "Invalid start column position in " +
                "range projection (..) " + startCol;
                throw new PlanValidationException(this, msg, 2270, PigException.BUG);
            }

            if(endCol > 0 && startCol > endCol){
                String msg = "start column appears after end column in " +
                "range projection (..) . Start column position " + startCol +
                " End column position " + endCol;
                throw new PlanValidationException(this, msg, 1127, PigException.INPUT);
            }
        }else{
            setColNum(findColNum(alias));
        }
    }
View Full Code Here

            if( colNum == -1 ) {
              String msg = "Invalid field projection. Projected field [" + alias + "] does not exist";
                if( inputSchema != null )
                  msg += " in schema: " + inputSchema.toString( false );
                msg += ".";
                throw new PlanValidationException( this, msg, 1025 );
            }
            return colNum;
        } else {
            int col = getColNum();
            if( inputSchema != null && col >= inputSchema.size() ) {
                throw new PlanValidationException( this,
                        "Out of bound access. Trying to access non-existent column: " +
                        col + ". Schema " +  inputSchema.toString(false) +
                        " has " + inputSchema.size() + " column(s)." , 1000);
            }
            return col;
View Full Code Here

                    break;
                }
                String msg = "The output file(s): " + filename
                + " already exists";
                msgCollector.collect(msg, MessageType.Error) ;
                throw new PlanValidationException(msg, errCode, errSrc);               
            }
        } catch (PlanValidationException pve) {
            throw pve;
        } catch (IOException ioe) {
            byte errSrc = pigCtx.getErrorSource();
            int errCode = 0;
            switch(errSrc) {
            case PigException.BUG:
                errCode = 2003;
                break;
            case PigException.REMOTE_ENVIRONMENT:
                errCode = 6001;
                break;
            case PigException.USER_ENVIRONMENT:
                errCode = 4001;
                break;
            }

            String msg = "Cannot read from the storage where the output "
                    + filename + " will be stored ";
            msgCollector.collect(msg, MessageType.Error) ;
            throw new PlanValidationException(msg, errCode, errSrc, ioe);
        } catch (Exception e) {
            int errCode = 2116;
            String msg = "Unexpected error. Could not check for the existence of the file(s): " + filename;
            msgCollector.collect(msg, MessageType.Error) ;
            throw new PlanValidationException(msg, errCode, PigException.BUG, e);
        }
    }
View Full Code Here

                    FuncSpec funcSpec = new FuncSpec(InterStorage.class.getName());
                    FileSpec fileSpec;
                    try {
                        fileSpec = new FileSpec( FileLocalizer.getTemporaryPath( pigContext ).toString(), funcSpec );                    // TODO: need to hookup the pigcontext.
                    } catch (IOException e) {
                        throw new PlanValidationException( expr, "Failed to process scalar" + e);
                    }
                    store = new LOStore( lp, fileSpec );
                    store.setTmpStore(true);
                    lp.add( store );
                    lp.connect( refOp, store );
View Full Code Here

                    if(seenAliases.contains(alias)){
                        int errCode = 1108;
                        String msg = "Duplicate schema alias: " + schema.getField( i ).alias;
                        if( op.getAlias() != null )
                            msg = msg + " in \"" + op.getAlias() + "\"";
                        throw new PlanValidationException( op, msg, errCode, PigException.INPUT );
                    }
                    seenAliases.add(alias);
                }
            }
        }
View Full Code Here

                //check duplicate uid
                if(!uidsSeen.add(fs.uid)){
                    // uid already seen
                    String msg = "Logical plan invalid state: duplicate uid in " +
                            "schema : " + schema;
                    throw new PlanValidationException(
                            msg,
                            2270,
                            PigException.BUG
                            );
                }
            }
           
            if(fs.uid < 0){
                String msg = "Logical plan invalid state: invalid uid " + fs.uid +
                        " in schema : " + schema;
                throw new PlanValidationException(
                        msg,
                        2271,
                        PigException.BUG
                        );
               
View Full Code Here

TOP

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

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.