Re: hive union all

2016-11-23 Thread 徐 鹏
could you please explain the sql
在 2016年11月24日,下午1:01,C R 
> 写道:

hi all,
all I want to say is here:





it is ok.





I feel a little embarrassed





According to my test,the same hive ql will be executed well in CDH version.



RE: hive union all same table

2015-03-31 Thread zhangjp
hive select ti,count(1) from xx  where day=20150330 group by ti union all 
select ti,count(1) from xx  where day=20150330 group by ti;Total jobs = 
3Launching Job 1 out of 3
From: smart...@hotmail.com
To: user@hive.apache.org
Subject: hive  union all  same table
Date: Wed, 1 Apr 2015 03:06:52 +




Hi  I want to query table_a by different where clause as follow
  select * from (  select  col1, count(1) from table_a where col2 ='xx' 
group by col1 union all select  col1, count(1) from table_a 
where col2 ='xx' group by col1 union all  select  col1, 
count(1) from table_a where col2 ='xx' group by col1 )
I found the total jobs is 4, is there any optimiztion?  I think it should scan 
table_a once and only one job   
   

hive union all same table

2015-03-31 Thread zhangjp
Hi  I want to query table_a by different where clause as follow
  select * from (  select  col1, count(1) from table_a where col2 ='xx' 
group by col1 union all select  col1, count(1) from table_a 
where col2 ='xx' group by col1 union all  select  col1, 
count(1) from table_a where col2 ='xx' group by col1 )
I found the total jobs is 4, is there any optimiztion?  I think it should scan 
table_a once and only one job