testOrderPreserveUnion(inputTables, "e,c,a,b,d,f,m1,source_table");
// Verify union table
ArrayList<ArrayList<Object>> resultTable = new ArrayList<ArrayList<Object>>();
addResultRow(resultTable, "Apple", 1003L, 1001, 100.0f, 50e+2, new DataByteArray("Apple"), m1, 0);
addResultRow(resultTable, "Hadoop", 1000L, 1002, 28.0f, 50e+2, new DataByteArray("Hadoop"),m1, 0);
addResultRow(resultTable, "Pig", 1000L, 1001, 50.0f, 50e+2, new DataByteArray("Pig"), m1, 0);
addResultRow(resultTable, "Zebra", 1001L, 5, -3.25f, 51e+2, new DataByteArray("Zebra"), m1, 0);
addResultRow(resultTable, "apple", 1001L, 1001, 101.0f, 50e+2, new DataByteArray("apple"), m1, 0);
addResultRow(resultTable, "beige", 1006L, 2000, 33.0f, 52e+2, new DataByteArray("beige"), m2, 1);
addResultRow(resultTable, "brown", 1001L, 1001, 53.0f, 52e+2, new DataByteArray("brown"), m2, 1);
addResultRow(resultTable, "gray", 1008L, 1001, 50.0f, 52e+2, new DataByteArray("gray"), m2, 1);
addResultRow(resultTable, "green", 1004L, 15, 56.0f, 50e+2, new DataByteArray("green"), m2, 1);
addResultRow(resultTable, "hadoop", 1002L, 1000, 0.0f, 52e+2, new DataByteArray("hadoop"),m1, 0);
addResultRow(resultTable, "orange", 1002L, -1, -99.0f, 51e+2, new DataByteArray("orange"),m2, 1);
addResultRow(resultTable, "pig", 1001L, 1001, 52.0f, 50e+2, new DataByteArray("pig"), m1, 0);
addResultRow(resultTable, "purple", 1001L, 1001, 102.0f, 52e+2, new DataByteArray("purple"),m2, 1);
addResultRow(resultTable, "string0",1000L, null, 3.25f, 53e+2, new DataByteArray("orange"),null, 2);
addResultRow(resultTable, "string0",1001L, null, 3.26f, 51e+2, new DataByteArray("purple"),null, 2);
addResultRow(resultTable, "string1",1000L, null, 3.25f, 50e+2, new DataByteArray("blue"), null, 2);
addResultRow(resultTable, "string1",1001L, null, 3.25f, 51e+2, new DataByteArray("green"), null, 2);
addResultRow(resultTable, "string1",1001L, null, 3.24f, 53e+2, new DataByteArray("yellow"),null, 2);
addResultRow(resultTable, "string2",1001L, null, 3.28f, 51e+2, new DataByteArray("white"), null, 2);
addResultRow(resultTable, "white", 1003L, 1001, 100.0f, 55e+2, new DataByteArray("white"), m2, 1);
addResultRow(resultTable, "zebra", 1000L, -1, 3.25f, 50e+2, new DataByteArray("zebra"), m1, 0);
// Verify union table
Iterator<Tuple> it = pigServer.openIterator("records1");
int numbRows = verifyTable(resultTable, 0, it);