Package org.apache.pig.tools.grunt

Examples of org.apache.pig.tools.grunt.Grunt.exec()


        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        try {
            grunt.exec();
        } catch (Exception e) {
            assertTrue(e.getMessage().contains("Encountered \"define\""));
        }
        assertTrue(null != context.getFuncSpecFromAlias("myudf"));
    }
View Full Code Here


        ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        grunt.exec();
    }

    @Test
    public void testBagSchemaFail() throws Throwable {
        PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
View Full Code Here

        InputStreamReader reader = new InputStreamReader(cmd);
       
        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

        ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        grunt.exec();
    }

    @Test
    public void testBagConstantWithSchema() throws Throwable {
        PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
View Full Code Here

        ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes("UTF-8"));
        InputStreamReader reader = new InputStreamReader(cmd);

        Grunt grunt = new Grunt(new BufferedReader(reader), pigServer.getPigContext());

        grunt.exec();
    }
   
    @Test
    public void testQueryParser() throws Exception{
      File f1 = File.createTempFile("tmp", "");
View Full Code Here

        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        try {
            grunt.exec();
        } catch (Exception e) {
            assertTrue(e.getMessage().contains("Encountered \"define\""));
        }
        assertTrue(null != context.getFuncSpecFromAlias("myudf"));
    }
View Full Code Here

        ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        grunt.exec();
    }

    @Test
    public void testBagSchemaFail() throws Throwable {
        PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
View Full Code Here

        InputStreamReader reader = new InputStreamReader(cmd);
       
        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

        ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        grunt.exec();
    }

    @Test
    public void testBagConstantWithSchema() throws Throwable {
        PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
View Full Code Here

        ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
        InputStreamReader reader = new InputStreamReader(cmd);
       
        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        grunt.exec();
    }

    @Test
    public void testBagConstantInForeachBlock() throws Throwable {
        PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.