Examples of ExecJob


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

            outputFile = File.createTempFile("JIAR_1027", ".out");
            String filePath = outputFile.getAbsolutePath();
            outputFile.delete();
            PigServer pig = new PigServer(ExecType.LOCAL);
            pig.registerQuery("A = load 'test/org/apache/pig/test/data/passwd';");
            ExecJob job = pig.store("A", filePath);
            PigStats stats = job.getStatistics();
            File dataFile = new File( outputFile.getAbsoluteFile() + File.separator + "part-00000" );
            assertEquals(dataFile.length(), stats.getBytesWritten());
        } catch (IOException e) {
            e.printStackTrace();
            System.err.println( e.getMessage() );
View Full Code Here

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

      Schema dumpedASchema = server.dumpSchema("A");
      server.registerQuery("STORE A into '" + tablename + "' using org.apache.hive.hcatalog.pig.HCatStorer("
        + (provideSchemaToStorer ? "'', '" + pigSchema + "'" : "")
        + ");");

      ExecJob execJob = server.executeBatch().get(0);
      if (!execJob.getStatistics().isSuccessful()) {
        throw new RuntimeException("Import failed", execJob.getException());
      }
      // test that schema was loaded correctly
      server.registerQuery("X = load '" + tablename + "' using org.apache.hive.hcatalog.pig.HCatLoader();");
      server.dumpSchema("X");
      Iterator<Tuple> it = server.openIterator("X");
View Full Code Here

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

      Schema dumpedASchema = server.dumpSchema("A");
      server.registerQuery("STORE A into '" + tablename + "' using org.apache.hcatalog.pig.HCatStorer("
        + (provideSchemaToStorer ? "'', '" + pigSchema + "'" : "")
        + ");");

      ExecJob execJob = server.executeBatch().get(0);
      if (!execJob.getStatistics().isSuccessful()) {
        throw new RuntimeException("Import failed", execJob.getException());
      }
      // test that schema was loaded correctly
      server.registerQuery("X = load '" + tablename + "' using org.apache.hcatalog.pig.HCatLoader();");
      server.dumpSchema("X");
      Iterator<Tuple> it = server.openIterator("X");
View Full Code Here

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

            }

            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

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

    /*
     * 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

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

    removeDir(newPath);

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

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

      System.out.println(RowValue);
    }

    try {
        Path newPath = new Path(getCurrentMethodName());
        ExecJob pigJob = pigServer
            .store(
                "records",
                new Path(newPath, "store").toString(),
                TableStorer.class.getCanonicalName()
                    + "('[s7, s2]; [s3, s4]')");
View Full Code Here

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

    }

    try {
        Path newPath = new Path(getCurrentMethodName());
       
        ExecJob pigJob = pigServer
              .store(
                  "records",
                  new Path(newPath, "store").toString(),
                  TableStorer.class.getCanonicalName()
                      + "('[s1, s2]; [s1, s4]')");
View Full Code Here

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

      System.out.println(RowValue);
    }
    try{
        Path newPath = new Path(getCurrentMethodName());
   
        ExecJob pigJob = pigServer
            .store(
                "records",
                new Path(newPath, "store").toString(),
                TableStorer.class.getCanonicalName()
                    + "('[s1]; [s1]')");
View Full Code Here

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

      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, s2]; [s3, s4]')");
    Assert.assertNotNull(pigJob.getException());
    System.out.println(pigJob.getException());
  }
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.