Package org.apache.pig.pigunit

Examples of org.apache.pig.pigunit.PigTest.runScript()


    PigTest test = createPigTest("datafu/bags/enumerateWithStartTest.pig");
      
    writeLinesToFile("input",
                     "({(10,{(1),(2),(3)}),(20,{(4),(5),(6)}),(30,{(7),(8)}),(40,{(9),(10),(11)}),(50,{(12),(13),(14),(15)})})");
   
    test.runScript();
   
    assertOutput(test, "data4",
                 "(10,{(1),(2),(3)},1)",
                 "(20,{(4),(5),(6)},2)",
                 "(30,{(7),(8)},3)",
View Full Code Here


    PigTest test = createPigTest("datafu/bags/enumerateTest.pig");
      
    writeLinesToFile("input",
                     "({(10,{(1),(2),(3)}),(20,{(4),(5),(6)}),(30,{(7),(8)}),(40,{(9),(10),(11)}),(50,{(12),(13),(14),(15)})})");
   
    test.runScript();
   
    assertOutput(test, "data4",
                 "(10,{(1),(2),(3)},0)",
                 "(20,{(4),(5),(6)},1)",
                 "(30,{(7),(8)},2)",
View Full Code Here

    PigTest test = createPigTest("datafu/bags/comprehensiveBagSplitAndEnumerate.pig");
   
    writeLinesToFile("input",
                     "({(A,1.0),(B,2.0),(C,3.0),(D,4.0),(E,5.0)})");
   
    test.runScript();
   
    assertOutput(test, "data_out",
                 // bag #1
                 "(A,1.0,1)",
                 "(B,2.0,1)",
View Full Code Here

    PigTest test = createPigTest("datafu/bags/aliasBagFieldsTest.pig");
   
    writeLinesToFile("input",
                     "({(A,1,0),(B,2,0),(C,3,0),(D,4,0),(E,5,0)})");
   
    test.runScript();
   
    assertOutput(test, "data4",
                 "(A,1)",
                 "(B,2)",
                 "(C,3)",
View Full Code Here

    PigTest test = createPigTest("datafu/bags/distinctByTest.pig");
   
    writeLinesToFile("input",
                     "({(Z,1,0),(A,1,0),(A,1,0),(B,2,0),(B,22,1),(C,3,0),(D,4,0),(E,5,0)})");
   
    test.runScript();
   
    assertOutput(test, "data2",
                 "({(Z,1,0),(A,1,0),(B,2,0),(C,3,0),(D,4,0),(E,5,0)})");
  }
View Full Code Here

    PigTest test = createPigTest("datafu/bags/sets/setIntersectTest.pig");
   
    this.writeLinesToFile("input",
                          "{(1,10),(3,30),(2,20),(4,40),(5,50),(6,60)}\t{(0,0),(2,20),(4,40),(8,80)}");
       
    test.runScript();
   
    this.getLinesForAlias(test, "data2");
  }
 
  @Test
View Full Code Here

                          coords(la,tokyo),
                          coords(ny,tokyo),
                          coords(ny,sydney),
                          coords(ny,paris));
   
    test.runScript();
   
    List<Tuple> distances = this.getLinesForAlias(test, "data2");
   
    // ensure distance is within 20 miles of expected (distances found online)
    assertWithin(5478.0, distances.get(0), 20.0); // la <-> tokyo
View Full Code Here

                          "2010-01-01T01:10:00Z\t3\t25",
                          "2010-01-01T01:15:00Z\t3\t50",
                          "2010-01-01T01:25:00Z\t3\t30",
                          "2010-01-01T01:30:00Z\t3\t15");
   
    test.runScript();
   
    HashMap<Integer,HashMap<Integer,Boolean>> userValues = new HashMap<Integer,HashMap<Integer,Boolean>>();
   
    for (Tuple t : this.getLinesForAlias(test, "max_value"))
    {
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.