Package org.apache.pig.backend.executionengine

Examples of org.apache.pig.backend.executionengine.ExecJob


      System.out.println(RowValue);
    }

    Path newPath = new Path(getCurrentMethodName());
   
    ExecJob pigJob = pigServer
          .store(
              "records",
              new Path(newPath, "store").toString(),
              TableStorer.class.getCanonicalName()
                  + "('s1:bool, s2:int, s3:long, s4:float, s5:string, s6:bytes', '[s1, s2]; [s1, s4]')");
      Assert.assertNotNull(pigJob.getException());
      System.out.println(pigJob.getException());
  }
View Full Code Here


      System.out.println(RowValue);
    }

    Path newPath = new Path(getCurrentMethodName());

    ExecJob pigJob = pigServer
        .store(
            "records",
            new Path(newPath, "store").toString(),
            TableStorer.class.getCanonicalName()
                + "('s1:bool, s2:int, s3:long, s4:float, s5:string, s6:bytes', '[s1]; [s1]')");
    Assert.assertNotNull(pigJob.getException());
    System.out.println(pigJob.getException());
  }
View Full Code Here

      Tuple RowValue = it.next();
      System.out.println(RowValue);
    }

    Path newPath = new Path(getCurrentMethodName());
    ExecJob pigJob = pigServer
        .store(
            "records",
            new Path(newPath, "store").toString(),
            TableStorer.class.getCanonicalName()
                + "('s1:int, s2:int, s3:long, s4:float, s5:string, s6:bytes', '[s1, s2]; [s3, s4]')");
    Assert.assertNotNull(pigJob.getException());
    System.out.println(pigJob.getException());
  }
View Full Code Here

    /*
     * Use pig STORE to store testing data
     */
   
    ExecJob pigJob = pigServer
        .store(
            "records",
            path.toString(),
            TableStorer.class.getCanonicalName()
                + "('s1:bool, s2:int, s3:long, s4:float, s5:string, s6:bytes', '[s1, s2]; [s3, s4]')");
    Assert.assertNotNull(pigJob.getException());
    System.out.println(pigJob.getException());
  }
View Full Code Here

    /*
     * Use pig STORE to store testing data BasicTable.Writer writer = new
     * BasicTable.Writer(pathTable, "SF_a,SF_b,SF_c,SF_d,SF_e,SF_f,SF_g",
     * "[SF_a, SF_b, SF_c]; [SF_e, SF_f, SF_g]", false, conf);
     */
    ExecJob pigJob = pigServer
        .store(
            "records",
            new Path(pathTable, "store").toString(),
            TableStorer.class.getCanonicalName()
                + "('[SF_a, SF_b, SF_c]; [SF_e]')");

    Assert.assertNull(pigJob.getException());
  }
View Full Code Here

    Path newPath = new Path(getCurrentMethodName());

    /*
     * Table1 creation
     */
    ExecJob pigJob = pigServer
        .store(
            "records6",
            newPath.toString()+"1",
            TableStorer.class.getCanonicalName()
                + "('[records3::SF_a]; [records4::SF_a]')");
    Assert.assertNull(pigJob.getException());
  }
View Full Code Here

            }

            if (currDAG.isBatchOn()) {
                currDAG.execute();
            }
            ExecJob job = store(id, FileLocalizer.getTemporaryPath(null, pigContext).toString(), BinStorage.class.getName() + "()");
           
            // invocation of "execute" is synchronous!

            if (job.getStatus() == JOB_STATUS.COMPLETED) {
                return job.getResults();
            } else if (job.getStatus() == JOB_STATUS.FAILED
                       && job.getException() != null) {
                // throw the backend exception in the failed case
                throw job.getException();
            } else {
                throw new IOException("Job terminated with anomalous status "
                    + job.getStatus().toString());
            }
        } catch (Exception e) {
            int errCode = 1066;
            String msg = "Unable to open iterator for alias " + id;
            throw new FrontendException(msg, errCode, PigException.INPUT, e);
View Full Code Here

    this.t1++;
   
    String table1path = this.pathTable1.toString() + Integer.toString(this.t1);
    

ExecJob pigJob =pigServer.store("sort1", table1path, TableStorer.class.getCanonicalName()
        + "('[a, b, c]; [d, e, f, r1, m1]')");
if (pigJob.getException() != null){
  System.out.println("******pig job exception"+ pigJob.getException().getMessage());
}
Assert.assertNull(pigJob.getException());
    String query3 = "records1 = LOAD '"
        + table1path
        + "' USING org.apache.hadoop.zebra.pig.TableLoader('a, b, c, d, e, f, r1, m1', 'sorted');";

    System.out.println("query3:" + query3);
    pigServer.registerQuery(query3);  
   
    String foreach = "records11 = foreach records1 generate a as a, b as b, c as c, d as d, e as e, f as f, r1 as r1, m1#'a' as ma1;";
    pigServer.registerQuery(foreach);
 
    /*
     * Table2 creation
     */
    this.t1++;
    String table2path = this.pathTable2.toString() + Integer.toString(this.t1);
    pigJob = pigServer.store("sort2", table2path, TableStorer.class.getCanonicalName()
        + "('[a, b, c]; [d,e,f,r1,m1]')");
    if (pigJob.getException() != null){
      System.out.println("******pig job exception"+ pigJob.getException().getMessage());
    }
    Assert.assertNull(pigJob.getException());
    String query4 = "records2 = LOAD '" + table2path
        + "' USING org.apache.hadoop.zebra.pig.TableLoader();";
    pigServer.registerQuery(query4);

   
View Full Code Here

        try {
            pigContext.getProperties().setProperty( PigContext.JOB_NAME, jobName );
            if( jobPriority != null ) {
                pigContext.getProperties().setProperty( PigContext.JOB_PRIORITY, jobPriority );
            }
            ExecJob job = store(id, FileLocalizer.getTemporaryPath(pigContext)
                    .toString(), Utils.getTmpFileCompressorName(pigContext)
                    + "()");

            // invocation of "execute" is synchronous!

            if (job.getStatus() == JOB_STATUS.COMPLETED) {
                return job.getResults();
            } else if (job.getStatus() == JOB_STATUS.FAILED
                    && job.getException() != null) {
                // throw the backend exception in the failed case
                Exception e = job.getException();
                int errCode = 1066;
                String msg = "Unable to open iterator for alias " + id
                        + ". Backend error : " + e.getMessage();
                throw new FrontendException(msg, errCode, PigException.INPUT, e);
            } else {
                throw new IOException("Job terminated with anomalous status "
                        + job.getStatus().toString());
            }
        } catch (FrontendException e) {
            throw e;
        } catch (Exception e) {
            int errCode = 1066;
View Full Code Here

        try {
            pigContext.getProperties().setProperty( PigContext.JOB_NAME, jobName );
            if( jobPriority != null ) {
                pigContext.getProperties().setProperty( PigContext.JOB_PRIORITY, jobPriority );
            }
            ExecJob job = store(id, FileLocalizer.getTemporaryPath(pigContext)
                    .toString(), Utils.getTmpFileCompressorName(pigContext)
                    + "()");

            // invocation of "execute" is synchronous!

            if (job.getStatus() == JOB_STATUS.COMPLETED) {
                return job.getResults();
            } else if (job.getStatus() == JOB_STATUS.FAILED
                    && job.getException() != null) {
                // throw the backend exception in the failed case
                Exception e = job.getException();
                int errCode = 1066;
                String msg = "Unable to open iterator for alias " + id
                        + ". Backend error : " + e.getMessage();
                throw new FrontendException(msg, errCode, PigException.INPUT, e);
            } else {
                throw new IOException("Job terminated with anomalous status "
                        + job.getStatus().toString());
            }
        } catch (FrontendException e) {
            throw e;
        } catch (Exception e) {
            int errCode = 1066;
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.executionengine.ExecJob

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.