Examples of registerScript()


Examples of org.apache.pig.LipstickPigServer.registerScript()

public class LOJsonAdaptorTest {
    @Test
    public void generalTest() throws Exception {
        LipstickPigServer lps = new LipstickPigServer("local");
        lps.setBatchOn();
        lps.registerScript("./src/test/resources/test.pig");

        LogicalPlan lp = getLogicalPlan(lps);

        for (Operator op : EzIterable.getIterable(lp.getOperators())) {
            LogicalRelationalOperator lro = (LogicalRelationalOperator) op;
View Full Code Here

Examples of org.apache.pig.LipstickPigServer.registerScript()

public class P2jPlanGeneratorTest {
    @Test
    public void generalTest() throws Exception {
        LipstickPigServer lps = new LipstickPigServer("local");
        lps.setBatchOn();
        lps.registerScript("./src/test/resources/test.pig");

        P2jPlanGenerator opg = new P2jPlanGenerator(lps.getLP(null));
        P2jPlan plan = opg.getP2jPlan();

        // Build a map of scope to id from the built plan
View Full Code Here

Examples of org.apache.pig.LipstickPigServer.registerScript()

public class MRPlanCalculatorTest {
    @Test
    public void generalTest() throws Exception {
        LipstickPigServer lps = new LipstickPigServer("local");
        lps.setBatchOn();
        lps.registerScript("./src/test/resources/test.pig");

        P2jPlanGenerator opg = getOpPlanGenerator(lps);

        MROperPlan plan = getMROperPlan(lps);
        Map<PhysicalOperator, Operator> p2lMap = getP2lMap(lps);
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

 
  //still to complete.
  @Test
  public void testContentOfPigScript() throws ExecException, IOException {
    PigServer pigServer = new PigServer("LOCAL");
    pigServer.registerScript("/tmp/pigScript.txt");
    //pigServer.registerQuery("A = LOAD 'mapreduce.jdbc.hiho.input.outputPath' USING PigStorage(',') AS (URL:chararray,PAGEVIEW:long);");
    /*pigServer.dumpSchema("A") ;
    String s;
        InputStream fileWithStdOutContents = new DataInputStream( new BufferedInputStream( new FileInputStream(new File("stdout.redirected"))));
        BufferedReader reader = new BufferedReader(new InputStreamReader(fileWithStdOutContents));
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

 
  @Test
  public void testUDFReturnMap_LocalMode() {
    try {
      PigServer pig = new PigServer(ExecType.LOCAL);
      pig.registerScript(TempScriptFile.getAbsolutePath());

      Iterator<Tuple> iterator = pig.openIterator("B");
      int index = 0;
      while (iterator.hasNext()) {
        Tuple tuple = iterator.next();
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

  }

  public void testUDFWithoutParameter() {
    try {
      PigServer pig = new PigServer(ExecType.LOCAL);
      pig.registerScript(TempScriptFile.getAbsolutePath());
     
      Iterator<Tuple> iterator=pig.openIterator("B");
      int index=0;
      while(iterator.hasNext()){
        Tuple tuple=iterator.next();
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

        for (String line : statement) {
            writer.write(line + "\n");
        }
        writer.close();
       
        pig.registerScript(tmpFile.getAbsolutePath());
        Iterator<Tuple> iterator = pig.openIterator("D");
        while (iterator.hasNext()) {
            Tuple tuple = iterator.next();
            if ("dumb".equals(tuple.get(0).toString())) {
                assertEquals(tuple.get(1).toString(), "joe");
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

       
        PigServer pig = new PigServer(ExecType.MAPREDUCE, cluster
                .getProperties());
       
        FileInputStream fis = new FileInputStream(inputScriptName);
        pig.registerScript(fis);
       
        FileSystem fs = FileSystem.get(ConfigurationUtil.toConfiguration(
                pig.getPigContext().getProperties()));
        FileStatus stat = fs.getFileStatus(new Path("output3/part-m-00000.bz2"));       
        assertTrue(stat.getLen() > 0);    
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

        for (String line : statement) {
            writer.write(line + "\n");
        }
        writer.close();
       
        pig.registerScript(tmpFile.getAbsolutePath());
        Iterator<Tuple> iterator = pig.openIterator("D");
        while (iterator.hasNext()) {
            Tuple tuple = iterator.next();
            if ("dumb".equals(tuple.get(0).toString())) {
                assertEquals(tuple.get(1).toString(), "joe");
View Full Code Here

Examples of org.apache.pig.PigServer.registerScript()

  @Test
  public void testUDFReturnMap_LocalMode() {
    try {
      PigServer pig = new PigServer(ExecType.LOCAL);
      pig.registerScript(TempScriptFile.getAbsolutePath());

      Iterator<Tuple> iterator = pig.openIterator("B");
      int index = 0;
      while (iterator.hasNext()) {
        Tuple tuple = iterator.next();
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.