Hey guys!

Two questions:


1) Is it possible to refer to an aliased column in the GROUP BY of a single
query? Hive is complaining if I try to do something like:

SELECT if(col1='x',1,0) AS MYALIAS, count(1)
   GROUP BY MYALIAS;

It seems like I have to re-paste the whole if(...) in the GROUP BY for the
query to work. If I have fairly complicated expressions in the SELECT, it's
a bit tedious to copy/paste them again in the GROUP BY. Am I missing
something here?

2) Also, if I have a large query in a myquery.q file to feed into the hive
cli via the -f option, can I specify comments before query so that the hive
engine ignores them? Syntax?

Thanks!

Ryan

Reply via email to