boolean isBeforeOptimizer = true;
LogicalPlanValidationExecutor validator = new LogicalPlanValidationExecutor(
plan, pigContext, isBeforeOptimizer);
validator.validate(plan, collector);
FunctionalLogicalOptimizer optimizer = new FunctionalLogicalOptimizer(
plan);
optimizer.optimize();
isBeforeOptimizer = false;
validator = new LogicalPlanValidationExecutor(
plan, pigContext, isBeforeOptimizer);
validator.validate(plan, collector);