Package org.apache.pig

Examples of org.apache.pig.PigException


        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        try {
            grunt.exec();
        } catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Encountered \" \";"));
        }
    }
View Full Code Here


        pigServer.registerQuery("c = foreach b generate flatten(group) as c0;");
       
        try {
            pigServer.openIterator("c");
        } catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            assertTrue(pe.getErrorCode()==1117);
            assertTrue(pe.getMessage().contains("Cannot merge"));
            return;
        }
        fail();
    }
View Full Code Here

            if (pe != null) {
                log.error("You don't have permission to perform the operation. Error from the server: " + pe.getMessage());
            }
        }

        PigException pigException = LogUtils.getPigException(t);

        if(pigException != null) {
            message = "ERROR " + pigException.getErrorCode() + ": " + pigException.getMessage();
        } else {
            if((t instanceof ParseException
                    || t instanceof org.apache.pig.tools.pigscript.parser.TokenMgrError
                    || t instanceof org.apache.pig.impl.logicalLayer.parser.TokenMgrError)) {
                message = "ERROR 1000: Error during parsing. " + t.getMessage();
View Full Code Here

        pigServer.registerQuery("B = FOREACH A generate x, " + UDF3.class.getName() + "(x,y);");
        try {
            Iterator<Tuple> iter = pigServer.openIterator("B");
        } catch(Exception e) {
            exceptionCaused = true;
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Multiple matching functions"));
            assertTrue(msg.contains("{float,double}, {float,long}"));
        }
        assertTrue(exceptionCaused);
    }
View Full Code Here

        pigServer.registerQuery("B = FOREACH A generate x, " + UDF3.class.getName() + "(x,y, y);");
        try {
            Iterator<Tuple> iter = pigServer.openIterator("B");
        }catch(Exception e) {
            exceptionCaused = true;
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Multiple matching functions"));
            assertTrue(msg.contains("({float,double,long}, {float,long,double})"));
        }
        assertTrue(exceptionCaused);
    }
View Full Code Here

        pigServer.registerQuery("B = FOREACH A generate x, " + UDF3.class.getName() + "(x,y, y);");
        try {
            Iterator<Tuple> iter = pigServer.openIterator("B");
        }catch(Exception e) {
            exceptionCaused = true;
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Multiple matching functions"));
            assertTrue(msg.contains("({float,double,long}, {float,long,double})"));
        }
        assertTrue(exceptionCaused);
    }
View Full Code Here

        pigServer.registerQuery("B = FOREACH A generate x, " + UDF3.class.getName() + "(x,y, y);");
        try {
            Iterator<Tuple> iter = pigServer.openIterator("B");
        }catch(Exception e) {
            exceptionCaused = true;
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Could not infer the matching function"));
        }
        assertTrue(exceptionCaused);
    }
View Full Code Here

        pigServer.registerQuery("B = FOREACH A generate x, " + UDF3.class.getName() + "(x,y, y);");
        try {
            Iterator<Tuple> iter = pigServer.openIterator("B");
        }catch(Exception e) {
            exceptionCaused = true;
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Multiple matching functions"));
            assertTrue(msg.contains("({float,double,long}, {float,long,double}"));
        }
        assertTrue(exceptionCaused);
    }
View Full Code Here

        pigServer.registerQuery("A = LOAD '" + inputFile + "' as (x:long, y:int);");
        pigServer.registerQuery("B = FOREACH A generate x, " + UDF1.class.getName() + "(y,y);");
        try{
            pigServer.openIterator("B");
        }catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertEquals(true,msg.contains("as multiple or none of them fit"));
        }
       
    }
View Full Code Here

        pigServer.registerQuery("A = LOAD '" + inputFile + "';");
        pigServer.registerQuery("B = FOREACH A generate $0, " + UDF1.class.getName() + "($1,$1);");
        try{
            pigServer.openIterator("B");
        }catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertEquals(true,msg.contains("Multiple matching functions"));
        }
       
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.PigException

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.