private static boolean hasTableAlias(JoinTypeCheckCtx ctx, String tabName, ASTNode expr) throws SemanticException { int tblAliasCnt = 0; for (RowResolver rr : ctx.getInputRRList()) { if (rr.hasTableAlias(tabName)) tblAliasCnt++; } if (tblAliasCnt > 1) { throw new SemanticException(ErrorMsg.AMBIGUOUS_TABLE_OR_COLUMN.getMsg(expr)); } return (tblAliasCnt == 1) ? true : false; }
private static ColumnInfo getColInfo( JoinTypeCheckCtx ctx, String tabName, String colAlias, ASTNode expr) throws SemanticException { ColumnInfo tmp; ColumnInfo cInfoToRet = null; for (RowResolver rr : ctx.getInputRRList()) { tmp = rr.get(tabName, colAlias); if (tmp != null) { if (cInfoToRet != null) { throw new SemanticException(ErrorMsg.AMBIGUOUS_TABLE_OR_COLUMN.getMsg(expr)); } cInfoToRet = tmp; } } return cInfoToRet; }