printCurrentMethodName();
LogicalPlan plan = new LogicalPlan();
String pigStorage = PigStorage.class.getName();
LOLoad load1 = newLOLoad(
new FileSpec("pi", new FuncSpec(pigStorage)),
null, plan, new Configuration(ConfigurationUtil.toConfiguration(pc.getFs().getConfiguration()))
);
LOLoad load2 = newLOLoad(
new FileSpec("pi", new FuncSpec(pigStorage)),
null, plan, new Configuration(ConfigurationUtil.toConfiguration(pc.getFs().getConfiguration()))
);
// schema for input#1
Schema inputSchema1 = null;
{
List<FieldSchema> fsList1 = new ArrayList<FieldSchema>();
fsList1.add(new FieldSchema("field1a", DataType.INTEGER));
fsList1.add(new FieldSchema("field2a", DataType.LONG));
fsList1.add(new FieldSchema(null, DataType.BYTEARRAY));
fsList1.add(new FieldSchema(null, DataType.CHARARRAY));
inputSchema1 = new Schema(fsList1);
}
// schema for input#2
Schema inputSchema2 = null;
{
List<FieldSchema> fsList2 = new ArrayList<FieldSchema>();
fsList2.add(new FieldSchema("field1b", DataType.DOUBLE));
fsList2.add(new FieldSchema(null, DataType.INTEGER));
fsList2.add(new FieldSchema("field3b", DataType.FLOAT));
fsList2.add(new FieldSchema("field4b", DataType.CHARARRAY));
inputSchema2 = new Schema(fsList2);
}
// set schemas
load1.setScriptSchema(org.apache.pig.newplan.logical.Util.translateSchema(inputSchema1));
load2.setScriptSchema(org.apache.pig.newplan.logical.Util.translateSchema(inputSchema2));
// create union operator
ArrayList<LogicalRelationalOperator> inputList = new ArrayList<LogicalRelationalOperator>();
inputList.add(load1);
inputList.add(load2);