*/
this.t1++;
String table1path = this.pathTable1.toString() + Integer.toString(this.t1);
removeDir(new Path(table1path));
ExecJob pigJob = pigServer.store("sort1", table1path, TableStorer.class.getCanonicalName()
+ "('[a, b, c]; [d, e, f, r1, m1]')");
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 as m1;";
pigServer.registerQuery(foreach);
// System.out.println( "Left table: >>>>>.");
// printTuples(pigServer.openIterator("records11"));
/* Iterator<Tuple> it_ordered = pigServer.openIterator("records1");
int row_ordered = 0;
Tuple RowValue_ordered = null;
while (it_ordered.hasNext()) {
RowValue_ordered = it_ordered.next();
row_ordered++;
System.out.println("row : " + row_ordered + " field a value: "
+ RowValue_ordered.get(0));
}
System.out.println("total row for table 1 after ordered:" + row_ordered);*/
/*
* Table2 creation
*/
this.t1++;
String table2path = this.pathTable2.toString() + Integer.toString(this.t1);
removeDir(new Path(table2path));
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);
// System.out.println( "Right table: >>>>>.");