Package org.apache.pig

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


    server.setBatchOn();
    server.registerQuery("A = load '" + fqdataLocation + "' using PigStorage(',') as (emp_id:int, emp_name:chararray, emp_dob:chararray, emp_sex:chararray);");
    server.registerQuery("store A into '" + NONPART_TABLE
        + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation + "', '', 'id:int, name:chararray, dob:chararray, sex:int');");
    try {
      server.executeBatch();
      fail("Expected exception not thrown");
    } catch (FrontendException e) {
    }
  }
View Full Code Here


        + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation + "', 'emp_country=in,emp_state=ka');");
    server.registerQuery("store USTN into '" + PARTITIONED_TABLE
        + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation + "', 'emp_country=us,emp_state=tn');");
    server.registerQuery("store USKA into '" + PARTITIONED_TABLE
        + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation + "', 'emp_country=us,emp_state=ka');");
    server.executeBatch();

    FileSystem fs = cluster.getFileSystem();

    System.out.println("Filesystem class : " + cluster.getFileSystem().getClass().getName() + ", fs.default.name : " + props.getProperty("fs.default.name"));
View Full Code Here

          .registerQuery("A = load '"
              + fqdataLocation
              + "' using PigStorage(',') as (emp_id:int, emp_name:chararray, emp_dob:chararray, emp_sex:chararray);");
      server.registerQuery("store A into '" + NONPART_TABLE
          + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation + "');");
      server.executeBatch();
    }
    {
      PigServer server = new PigServer(ExecType.LOCAL, props);
      UDFContext.getUDFContext().setClientSystemProps();
View Full Code Here

          .registerQuery("A = load '"
              + fqdataLocation
              + "' using PigStorage(',') as (emp_id:int, emp_name:chararray, emp_dob:chararray, emp_sex:chararray);");
      server.registerQuery("store A into '" + NONPART_TABLE
          + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation + "');");
      server.executeBatch();
    }
    {
      PigServer server = new PigServer(ExecType.LOCAL, props);
      UDFContext.getUDFContext().setClientSystemProps();
View Full Code Here

          + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation +
          "', 'emp_country=us,emp_state=tn');");
      server.registerQuery("store USKA into '" + PARTITIONED_TABLE
          + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation +
          "', 'emp_country=us,emp_state=ka');");
      server.executeBatch();
    }
    {
      PigServer server = new PigServer(ExecType.LOCAL, props);
      UDFContext.getUDFContext().setClientSystemProps();
View Full Code Here

          + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation +
          "', 'emp_country=us,emp_state=tn');");
      server.registerQuery("store USKA into '" + PARTITIONED_TABLE
          + "' using org.apache.hcatalog.pig.HCatEximStorer('" + fqexportLocation +
          "', 'emp_country=us,emp_state=ka');");
      server.executeBatch();
    }
    {
      PigServer server = new PigServer(ExecType.LOCAL, props);
      UDFContext.getUDFContext().setClientSystemProps();
View Full Code Here

    UDFContext.getUDFContext().setClientSystemProps();
    server.setBatchOn();
    server.registerQuery("A = load '"+basicFileFullName+"' as (a:int, b:chararray);");
    server.registerQuery("store A into '"+BASIC_TABLE+"' using org.apache.hcatalog.pig.HCatStorer();");

    server.executeBatch();

    driver.run("select * from "+BASIC_TABLE);
    ArrayList<String> unpartitionedTableValuesReadFromHiveDriver = new ArrayList<String>();
    driver.getResults(unpartitionedTableValuesReadFromHiveDriver);
    assertEquals(basicInputData.size(),unpartitionedTableValuesReadFromHiveDriver.size());
View Full Code Here

    server.registerQuery("B2 = filter A by a < 2;");
    server.registerQuery("store B2 into '"+PARTITIONED_TABLE+"' using org.apache.hcatalog.pig.HCatStorer('bkt=0');");
    server.registerQuery("C2 = filter A by a >= 2;");
    server.registerQuery("store C2 into '"+PARTITIONED_TABLE+"' using org.apache.hcatalog.pig.HCatStorer('bkt=1');");

    server.executeBatch();

    driver.run("select * from "+PARTITIONED_TABLE);
    ArrayList<String> partitionedTableValuesReadFromHiveDriver = new ArrayList<String>();
    driver.getResults(partitionedTableValuesReadFromHiveDriver);
    assertEquals(basicInputData.size(),partitionedTableValuesReadFromHiveDriver.size());
View Full Code Here

    server.registerQuery("B2 = filter A by a < 2;");
    server.registerQuery("store B2 into '"+PARTITIONED_TABLE+"' using org.apache.hcatalog.pig.HCatStorer('bkt=0');");
    server.registerQuery("C2 = filter A by a >= 2;");
    server.registerQuery("store C2 into '"+PARTITIONED_TABLE+"' using org.apache.hcatalog.pig.HCatStorer('bkt=1');");

    server.executeBatch();

    driver.run("select * from "+BASIC_TABLE);
    ArrayList<String> unpartitionedTableValuesReadFromHiveDriver = new ArrayList<String>();
    driver.getResults(unpartitionedTableValuesReadFromHiveDriver);
    driver.run("select * from "+PARTITIONED_TABLE);
View Full Code Here

    server.registerQuery("C2 = filter C by a >= 2;");
    server.registerQuery("store C2 into '"+PARTITIONED_TABLE+"' using org.apache.hcatalog.pig.HCatStorer('bkt=1');");

    server.registerQuery("D = load '"+fullFileNameComplex+"' as (name:chararray, studentid:int, contact:tuple(phno:chararray,email:chararray), currently_registered_courses:bag{innertup:tuple(course:chararray)}, current_grades:map[ ] , phnos :bag{innertup:tuple(phno:chararray,type:chararray)});");
    server.registerQuery("store D into '"+COMPLEX_TABLE+"' using org.apache.hcatalog.pig.HCatStorer();");
    server.executeBatch();

  }
  private void cleanup() throws IOException, CommandNeedRetryException {
    MiniCluster.deleteFile(cluster, basicFile);
    MiniCluster.deleteFile(cluster, complexFile);
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.