Examples of PigTest


Examples of org.apache.pig.pigunit.PigTest

  }

   @Test
  public void firstTupleFromBagTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/firstTupleFromBagTest.pig");

    writeLinesToFile("input", "1\t{(4),(9),(16)}");

    test.runScript();

    assertOutput(test, "data2", "(1,(4))");
  }
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

 
  @Test
  public void prependToBagTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/prependToBagTest.pig");
   
    writeLinesToFile("input",
                     "1\t{(1),(2),(3)}\t(4)",
                     "2\t{(10),(20),(30),(40),(50)}\t(60)");
                 
    test.runScript();
           
    assertOutput(test, "data2",
                 "(1,{(4),(1),(2),(3)})",
                 "(2,{(60),(10),(20),(30),(40),(50)})");
  }
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void bagConcatTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/bagConcatTest.pig");

    writeLinesToFile("input",
                     "({(1),(2),(3)}\t{(3),(5),(6)}\t{(10),(13)})",
                     "({(2),(3),(4)}\t{(5),(5)}\t{(20)})");
                 
    test.runScript();
           
    assertOutput(test, "data2",
                 "({(1),(2),(3),(3),(5),(6),(10),(13)})",
                 "({(2),(3),(4),(5),(5),(20)})");
  }
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void unorderedPairsTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/unorderedPairsTests.pig");
   
    String[] input = {
      "{(1),(2),(3),(4),(5)}"
    };
   
    String[] output = {
        "(1,2)",
        "(1,3)",
        "(1,4)",
        "(1,5)",
        "(2,3)",
        "(2,4)",
        "(2,5)",
        "(3,4)",
        "(3,5)",
        "(4,5)"
      };
   
    test.assertOutput("data",input,"data4",output);
  }
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void unorderedPairsTest2() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/unorderedPairsTests2.pig");
       
    this.writeLinesToFile("input", "1\t{(1),(2),(3),(4),(5)}");
   
    String[] output = {
        "(1,2)",
        "(1,3)",
        "(1,4)",
        "(1,5)",
        "(2,3)",
        "(2,4)",
        "(2,5)",
        "(3,4)",
        "(3,5)",
        "(4,5)"
      };
   
    test.runScript();
    this.getLinesForAlias(test, "data3");
   
    this.assertOutput(test, "data3",
                      "(1,(1),(2))",
                      "(1,(1),(3))",
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
  @Test
  public void bagSplitTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/bagSplitTest.pig",
                                 "MAX=5");
   
    writeLinesToFile("input",
                     "{(1,11),(2,22),(3,33),(4,44),(5,55),(6,66),(7,77),(8,88),(9,99),(10,1010),(11,1111),(12,1212)}");
   
    test.runScript();
   
    assertOutput(test, "data3",
                 "({(1,11),(2,22),(3,33),(4,44),(5,55)})",
                 "({(6,66),(7,77),(8,88),(9,99),(10,1010)})",
                 "({(11,1111),(12,1212)})");
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void bagSplitWithBagNumTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/bagSplitWithBagNumTest.pig",
                                 "MAX=10");
   
    writeLinesToFile("input",
                     "{(1,11),(2,22),(3,33),(4,44),(5,55),(6,66),(7,77),(8,88),(9,99),(10,1010),(11,1111),(12,1212)}");
   
    test.runScript();
   
    assertOutput(test, "data3",
                 "({(1,11),(2,22),(3,33),(4,44),(5,55),(6,66),(7,77),(8,88),(9,99),(10,1010)},0)",
                 "({(11,1111),(12,1212)},1)");
  }
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void enumerateWithReverseTest() throws Exception
  {
    PigTest test = createPigTest("datafu/bags/enumerateWithReverseTest.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)},5)",
                 "(20,{(4),(5),(6)},4)",
                 "(30,{(7),(8)},3)",
View Full Code Here

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void enumerateWithStartTest() throws Exception
  {
    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

Examples of org.apache.pig.pigunit.PigTest

  }
 
  @Test
  public void enumerateTest() throws Exception
  {
    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
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.