Hi! While working on PHOENIX-6365, I realized that the way we handle aliased tables (correlation names) does not comply with the SQL standard, which states tables that have a correlation name defined, should not be accessible by the original name.
In a nutshell, *select table.x from table as alias; *should not work, but it does now. Apart from being no standards-compliant, this is a particular problem for self joins, where queries like *select table.*, alias.* from table, table as alias where table.id <http://table.id> = 1 and alias.id <http://alias.id>=2;* really don't play well with the current behaviour (this was likely one of the reasons the standard is written like it is) IMO we should just fix Phoenix to be compliant, however, as I don't have the context on why Phoenix works like this, I'd like to ask everyone: Is the current behaviour an important compatibility workaround for some other DB which is also non-compliant, and if it is, is this (still) important enough not to fix this, or at least provide some way to preserve bug compatibility, and take the associated complexity hit, while fixing it ? Istvan
