PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/test/queries/clientpositive/union11.q

#
text | 20 lines | 13 code | 7 blank | 0 comment | 0 complexity | de78d32be58be77c0f7ce6eb69bc9664 MD5 | raw file
 1set hive.map.aggr = true;
 2
 3-- union case: all subqueries are a map-reduce jobs, 3 way union, same input for all sub-queries, followed by reducesink
 4
 5explain 
 6  select unionsrc.key, count(1) FROM (select 'tst1' as key, count(1) as value from src s1
 7                                        UNION  ALL  
 8                                            select 'tst2' as key, count(1) as value from src s2
 9                                        UNION ALL
10                                            select 'tst3' as key, count(1) as value from src s3) unionsrc group by unionsrc.key;
11
12
13  select unionsrc.key, count(1) FROM (select 'tst1' as key, count(1) as value from src s1
14                                        UNION  ALL  
15                                            select 'tst2' as key, count(1) as value from src s2
16                                        UNION ALL
17                                            select 'tst3' as key, count(1) as value from src s3) unionsrc group by unionsrc.key;
18
19
20