PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
text | 21 lines | 13 code | 8 blank | 0 comment | 0 complexity | cb2b915ccedd190e37a4842c564c9526 MD5 | raw file
 1set hive.map.aggr = true;
 2
 3-- union case: 1 subquery is a map-reduce job, different inputs for sub-queries, followed by filesink
 4
 5
 6create table tmptable(key string, value string);
 7
 8explain 
 9insert overwrite table tmptable
10  select unionsrc.key, unionsrc.value FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
11                                        UNION  ALL  
12                                            select s2.key as key, s2.value as value from src1 s2) unionsrc;
13
14insert overwrite table tmptable
15select unionsrc.key, unionsrc.value FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
16                                      UNION  ALL  
17                                          select s2.key as key, s2.value as value from src1 s2) unionsrc;
18
19select * from tmptable x sort by x.key, x.value;
20
21