Operator getOptimizedHiveOPDag(RelNode optimizedOptiqPlan) throws SemanticException {
    Operator<?> hiveRoot = new HiveOpConverter(this, conf, unparseTranslator, topOps)
                                  .convert(optimizedOptiqPlan);
    RowResolver hiveRootRR = genRowResolver(hiveRoot, getQB());
    opParseCtx.put(hiveRoot, new OpParseContext(hiveRootRR));
    String dest = getQB().getParseInfo().getClauseNames().iterator().next();
    if (isInsertInto(getQB().getParseInfo(), dest)) {
      Operator<?> selOp = handleInsertStatement(dest, hiveRoot, hiveRootRR, getQB());
      return genFileSinkPlan(dest, getQB(), selOp);
    } else {
      return genFileSinkPlan(dest, getQB(), hiveRoot);
    }
  }
Get Optimized Hive Operator DAG for the given QB tree in the semAnalyzer.

@return Optimized Hive operator tree
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java