How can I have a column in Hive be defined as a subquery? Is this possible in Hive?
I am trying to do something as given below in hive table. How can I have a column in Hive be defined as a subquery? Is it possible?
hive -e "
select
distinct a.listid,
(select count(*)
from directory x
where x.registrid = a.listid
) as dircount
from Impressions a
where a.yyyymmdd = 20180606
limit 20" > myfile.txt
Hive history file=/tmp/jd/hive_job_log_jd_201205123049_550961220.txt
FAILED: Parse Error: line 4:1 cannot recognize input near 'select' 'count' '(' in expression specification