tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}
inserters[i].insert(new BytesWritable(("key1" + i).getBytes()), tuple);
}
}
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}
writer.close();
/*
* create 2nd basic table;
*/
pathTable2 = new Path(pathWorking, "TestBasicTableUnion" + "2");
System.out.println("pathTable2 =" + pathTable2);
writer = new BasicTable.Writer(pathTable2, "a:string,b,d:string",
"[a,b];[d]", conf);
schema = writer.getSchema();
tuple = TypesUtils.createTuple(schema);
inserters = new TableInserter[numsInserters];
for (int i = 0; i < numsInserters; i++) {
inserters[i] = writer.getInserter("ins" + i, false);
}
for (int b = 0; b < numsBatch; b++) {
for (int i = 0; i < numsInserters; i++) {
TypesUtils.resetTuple(tuple);
for (int k = 0; k < tuple.size(); ++k) {
try {
tuple.set(k, b + "_" + i + "" + k);
} catch (ExecException e) {
e.printStackTrace();
}
}
inserters[i].insert(new BytesWritable(("key2" + i).getBytes()), tuple);
}
}
for (int i = 0; i < numsInserters; i++) {
inserters[i].close();
}