}
private static void populateAliases(SqlNode from, List<String> aliases,
String current) {
if (from instanceof SqlJoin) {
SqlJoin join = (SqlJoin) from;
populateAliases(join.getLeft(), aliases, null);
populateAliases(join.getRight(), aliases, null);
} else if (from.getKind() == SqlKind.AS) {
populateAliases(SqlUtil.stripAs(from), aliases,
SqlValidatorUtil.getAlias(from, -1));
} else {
if (current == null) {