List<LogicalOperator> successors = mPlan.getSuccessors(stream);
if(successors == null)
return;
LogicalOperator successor = successors.get(0);
if(successor instanceof LOStore) {
LOStore store = (LOStore)successor;
// Try and optimize if the store and stream output specs match
// and input files are to be processed as-is
StreamingCommand command = stream.getStreamingCommand();
HandleSpec streamOutputSpec = command.getOutputSpec();
FileSpec storeFileSpec = store.getOutputFile();
// Instantiate both to compare them for equality
LoadFunc streamLoader =
(LoadFunc)PigContext.instantiateFuncFromSpec(
streamOutputSpec.getSpec());