return plan;
}
void registerQuery(String query, int startLine) throws IOException {
LogicalPlan tmpLp = parseQuery(query, startLine);
// store away the query for use in cloning later
scriptCache.add(query);
if (tmpLp.getLeaves().size() == 1) {
LogicalOperator op = tmpLp.getSingleLeafPlanOutputOp();
// Check if we just processed a LOStore i.e. STORE
if (op instanceof LOStore) {
if (!batchMode) {
lp = tmpLp;
try {
execute();
} catch (Exception e) {
int errCode = 1002;
String msg = "Unable to store alias "
+ op.getOperatorKey().getId();
throw new FrontendException(msg, errCode,
PigException.INPUT, e);
}
} else {
if (0 == ignoreNumStores) {
storeOpTable.put((LOStore)op, tmpLp);
lp.mergeSharedPlan(tmpLp);
List<LogicalOperator> roots = tmpLp.getRoots();
for (LogicalOperator root : roots) {
if (root instanceof LOLoad) {
loadOps.add((LOLoad)root);
}
}