Hi,

Hive order by not working properly with columns involved in functions.

Column without function:
SELECT ACCOUNTID from table order by ACCOUNTID;
(Above query works fine in both HIVE & MYSQL)
Column with function:
SELECT concat('test_',ACCOUNTID) from table order by ACCOUNTID;
In mysql , Above query working fine.
In hive, below exception thrown
FAILED: SemanticException [Error 10004]: Line 1:59 Invalid table alias or 
column reference 'ACCOUNTID': (possible column names are: _c0)
Temporary Solution :
SELECT concat('test_',ACCOUNTID) as tempColumn from table order by tempcolumn;
Is there any solution available without assigning column as tempcolumn ?
Thanks 
Vengatesh Babu K M





Reply via email to