Package org.apache.pig.pigunit

Examples of org.apache.pig.pigunit.PigTest


  public void testArgFiles() throws ParseException, IOException {
    String[] argsFile = {
        "test/data/pigunit/top_queries_params.txt"
    };

    test = new PigTest(PIG_SCRIPT, null, argsFile);

    test.assertOutput(new File("test/data/pigunit/top_queries_expected_top_3.txt"));
  }
View Full Code Here


        "queries_ordered = ORDER queries_sum BY count DESC PARALLEL 1;",
        "queries_limit = LIMIT queries_ordered 3;",
        "STORE queries_limit INTO 'top_3_queries';",
    };

    test = new PigTest(script);

    String expected =
        "(yahoo,25)\n" +
        "(facebook,15)\n" +
        "(twitter,7)";
View Full Code Here

        "queries_ordered = ORDER queries BY query DESC PARALLEL 1;",
        "queries_limit = LIMIT queries_ordered 3;",
        "STORE queries_limit INTO 'top_3_queries';",
    };

    test = new PigTest(script);

    String[] output = {
        "(yahoo,{(yahoo)})",
        "(yahoo,{(yahoo)})",
        "(twitter,{(twitter)})",
View Full Code Here

        "n=3",
        "reducers=1",
        "input=top_queries_input_data.txt",
        "output=top_3_queries",
        };
    test = new PigTest(PIG_SCRIPT, args);

    // By default PigUnit removes all the STORE and DUMP
    test.unoverride("STORE");

    test.runScript();
View Full Code Here

        };

    PigServer mockServer = null;
    Cluster mockCluster = null;

    test = new PigTest(PIG_SCRIPT, args, mockServer, mockCluster);

    test.assertOutput(new File("data/top_queries_expected_top_3.txt"));
  }
View Full Code Here

      pig = new PigServer(ExecType.LOCAL);
    }

    final Cluster cluster = new Cluster(pig.getPigContext());

    test = new PigTest(scriptPath, args, pig, cluster);

    String[] output = {
        "(yahoo,25)",
        "(facebook,15)",
        "(twitter,7)",
View Full Code Here

                        "n=3",
                        "reducers=1",
                        "input=top_queries_input_data.txt",
                        "output=top_3_queries",
        };
        test = new PigTest(PIG_SCRIPT, args);

        String[] output = {
                        "(yahoo,25)",
                        "(facebook,15)",
                        "(twitter,7)",
View Full Code Here

                        "n=3",
                        "reducers=1",
                        "input=top_queries_input_data.txt",
                        "output=top_3_queries",
        };
        test = new PigTest(PIG_SCRIPT, args);

        String[] output = {
                        "(yahoo,25)",
                        "(facebook,15)",
                        "(twitter,7)",
View Full Code Here

                        "n=3",
                        "reducers=1",
                        "input=top_queries_input_data.txt",
                        "output=top_3_queries",
        };
        test = new PigTest(PIG_SCRIPT, args);

        String[] input = {
                        "yahoo\t10",
                        "twitter\t7",
                        "facebook\t10",
View Full Code Here

                        "n=3",
                        "reducers=1",
                        "input=top_queries_input_data.txt",
                        "output=top_3_queries",
        };
        test = new PigTest(PIG_SCRIPT, args);

        String[] input = {
                        "yahoo,10",
                        "twitter,7",
                        "facebook,10",
View Full Code Here

TOP

Related Classes of org.apache.pig.pigunit.PigTest

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.