void getMetaData(QB qb, boolean enableMaterialization) throws SemanticException {
    try {
      Map<String, CTEClause> materializationAliasToCTEs = null;
      if (enableMaterialization) {
        materializationAliasToCTEs = getMaterializationMetadata(qb);
      }
      checkRecursiveCTE(rootClause, new HashSet<>());
      getMetaData(qb, null);
      if (materializationAliasToCTEs != null && !materializationAliasToCTEs.isEmpty()) {
        this.aliasToCTEs.putAll(materializationAliasToCTEs);
      }
    } catch (HiveException e) {
      if (e instanceof SemanticException) {
        throw (SemanticException)e;
      }
      throw new SemanticException(e.getMessage(), e);
    }
  }
This is phase1 of supporting specifying schema in insert statement
insert into foo(z,y) select a,b from bar;
@see #handleInsertStatementSpec(java.util.List, String, RowResolver, QB, ASTNode)
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java