// If we found something, then try to resolve it unless the two nodes are the same
if (aliasedNode != null && !node.equals(aliasedNode)) {
try {
// If we're able to resolve it, that means we have a conflict
resolver.resolveColumn(node.getSchemaName(), node.getTableName(), node.getName());
throw new AmbiguousColumnException(node.getName());
} catch (ColumnNotFoundException e) {
// Not able to resolve alias as a column name as well, so we use the alias
return aliasedNode;
}
}