【发布时间】:2014-09-25 00:47:52
【问题描述】:
场景如下:当我如下调用 hql 时,它告诉我找不到 u1 的别名。
hive> select user as u1, url as u2 from rank_test where u1 != "";
FAILED: SemanticException [Error 10004]: Line 1:50 Invalid table alias or column reference 'u1': (possible column names are: user, url)
这个问题和我尝试使用count(*) as cnt时一样。谁能给我一些关于如何在 where 子句中使用别名的提示?非常感谢!
hive> select user, count(*) as cnt from rank_test where cnt >= 2 group by user;
FAILED: ParseException line 1:58 missing EOF at 'where' near 'user'
【问题讨论】: