protected T processQualifiedColRef(TypeCheckCtx ctx, ASTNode expr,
        Object... nodeOutputs) throws SemanticException {
      RowResolver input = ctx.getInputRR();
      String tableAlias = BaseSemanticAnalyzer.unescapeIdentifier(expr.getChild(0).getChild(0)
          .getText());
      // NOTE: tableAlias must be a valid non-ambiguous table alias,
      // because we've checked that in TOK_TABLE_OR_COL's process method.
      T desc = (T) nodeOutputs[1];
      String colName;
      if (exprFactory.isConstantExpr(desc)) {
        colName = exprFactory.getConstantValueAsString(desc);
      } else if (exprFactory.isColumnRefExpr(desc)) {
        colName = exprFactory.getColumnName(desc, input);
      } else {
        throw new SemanticException("Unexpected ExprNode : " + nodeOutputs[1]);
      }

      ColumnInfo colInfo = input.get(tableAlias, colName);
      RowResolver usedRR = input;
      int offset = 0;

      // Try outer Row resolver
      if (colInfo == null && ctx.getOuterRR() != null) {
        RowResolver outerRR = ctx.getOuterRR();
        colInfo = outerRR.get(tableAlias, colName);
        usedRR = outerRR;
        offset = input.getColumnInfos().size();
      }

      if (colInfo == null) {
        ctx.setError(ASTErrorUtils.getMsg(
            ErrorMsg.INVALID_COLUMN.getMsg(), expr.getChild(1)), expr);
        return null;
      }
      return exprFactory.toExpr(colInfo, usedRR, offset);
    }
Returns true if des is a descendant of ans (ancestor)
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java