hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhangjp <smart...@hotmail.com>
Subject RE: hive union all same table
Date Wed, 01 Apr 2015 03:11:55 GMT
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: smartzjp@hotmail.com
To: user@hive.apache.org
Subject: hive  union all  same table
Date: Wed, 1 Apr 2015 03:06:52 +0000




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 		 	   		   		 	   		  
Mime
View raw message