hive中比较神奇的地方,如下语句
select to_date(created) aaa , count(distinct mfsha1)
from piracy_apk
group by to_date(created)
order by to_date(created);
会报这个错,FAILED: SemanticException [Error 10004]: Line 1:112 Invalid table alias or column reference 'created': (possible column names are: aaa, _c1)
select to_date(created) aaa , count(distinct mfsha1)
from piracy_apk
group by aaa
order by aaa;
会报这个错:FAILED: SemanticException [Error 10004]: Line 1:78 Invalid table alias or column reference 'aaa'。
只有如下语句是正确的:
select to_date(created) aaa , count(distinct mfsha1)
from piracy_apk
group by to_date(created)
order by aaa;
为什么会出现这么诡异的事情呢?
待续。。。