}
}
private ExecJob optimizeAndRunQuery(LogicalPlan root) throws ExecException {
// Optimize the LogicalPlan
Optimizer loadOptimizer = new LoadOptimizer();
loadOptimizer.optimize(root);
Optimizer storeOptimizer = new StoreOptimizer();
storeOptimizer.optimize(root);
// Execute
ExecPhysicalPlan pp =
pigContext.getExecutionEngine().compile(root, null);