long time = System.currentTimeMillis();
String Result;
PigContext pigContext = new PigContext(ExecType.LOCAL, hadoopPigContext.getProperties());
//compile the logical plan to get the physical plan once and for all
ExecPhysicalPlan PhyPlan = null;
try {
pigContext.connect();
PhyPlan = pigContext.getExecutionEngine().compile(plan, null);
} catch (ExecException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Map<OperatorKey, OperatorKey> logicalToPhysicalKeys = ((LocalExecutionEngine)pigContext.getExecutionEngine()).getLogicalToPhysicalMap();
Map<OperatorKey, ExecPhysicalOperator> physicalOpTable = PhyPlan.getOpTable();
// Acquire initial base data by sampling from input relations (this is idempotent)
FetchBaseData.ReadBaseData(plan.getRootOperator(), GlobalBaseData, SAMPLE_SIZE, hadoopPigContext);
/////// PASS 1: push data sample through query plan