Select with ordinals in group by


#1

When writing queries, it is not uncommon to phrase them:

SELECT X FROM tablename GROUP BY 1 ORDER BY 1 ASC

This will work in MapD.

However, the following will not (ie. putting in an AS):

SELECT X AS XName FROM tablename GROUP BY 1 ORDER BY 1 ASC


#2

Error it produces is:
Exception: Exception occurred: org.apache.calcite.runtime.CalciteContextException: At line 4, column 10: Expression ‘tablename.X’ is not being grouped"


#3

Hi

Please confirm you are running latest release v3.3.1. This needs calcite 1.14 which is in v3.3.1.

Regards