fe/src/main/java/com/cloudera/impala/analysis/WithClause.java
/**
   * Adds all unresolved table references from stmt's WITH-clause
   * to unresolvedTableRefs, enabling view replacement for them so they can be
   * resolved in parent scopes. Does nothing if stmt has no WITH clause.
   */
Adds all unresolved table references from stmt's WITH-clause
to unresolvedTableRefs, enabling view replacement for them so they can be
resolved in parent scopes. Does nothing if stmt has no WITH clause.
Adds all unresolved table references from stmt ' s WITH - clause to unresolvedTableRefs enabling view replacement for them so they can be resolved in parent scopes . Does nothing if stmt has no WITH clause .
private void popScope(Analyzer analyzer, QueryStmt stmt,
      ArrayList<BaseTableRef> unresolvedTableRefs) {
    if (stmt.hasWithClause()) {
      ArrayList<BaseTableRef> nestedUnresolvedTableRefs =
          stmt.getWithClause().getUnresolvedTableRefs();
      for (BaseTableRef baseTblRef: nestedUnresolvedTableRefs) {
        baseTblRef.enableWithViewReplacement();
      }
      unresolvedTableRefs.addAll(nestedUnresolvedTableRefs);
    }
  }
private void popScope ( Analyzer analyzer , QueryStmt stmt , ArrayList < BaseTableRef > unresolvedTableRefs ) { if ( stmt . hasWithClause ( ) ) { ArrayList < BaseTableRef > nestedUnresolvedTableRefs = stmt . getWithClause ( ) . getUnresolvedTableRefs ( ) ; for ( BaseTableRef baseTblRef : nestedUnresolvedTableRefs ) { baseTblRef . enableWithViewReplacement ( ) ; } unresolvedTableRefs . addAll ( nestedUnresolvedTableRefs ) ; } }
Adds all unresolved table references from stmt's WITH-clause
 to unresolvedTableRefs, enabling view replacement for them so they can be
 resolved in parent scopes.
Adds all unresolved table references from stmt ' s WITH - clause to unresolvedTableRefs enabling view replacement for them so they can be resolved in parent scopes .
// Since we are in a nested WITH clause (scope) re-enable view replacement to // allow the references to be resolved in the parent scope.