In a "GROUP BY ordinal" query, validator gives invalid "Expression is not being grouped" error if column has alias.
Patch in https://github.com/apache/calcite/pull/490.
Resolved in release 1.14.0 (2017-10-01)
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/d4ab1e50.
Reviewing and testing now.
More details & patch in the linked PR. For some reason, not clear to me at this point, the error only happens if you are also ordering by an ordinal (like "group by 1 order by 1").