PageRenderTime 6ms 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/groupby11.q

#
text | 27 lines | 17 code | 10 blank | 0 comment | 0 complexity | fa44bbb8a4164ec6965c0e62ba9cec6b MD5 | raw file
 1set hive.map.aggr=false;
 2set hive.groupby.skewindata=true;
 3
 4
 5
 6
 7CREATE TABLE dest1(key STRING, val1 INT, val2 INT) partitioned by (ds string);
 8CREATE TABLE dest2(key STRING, val1 INT, val2 INT) partitioned by (ds string);
 9
10EXPLAIN
11FROM src
12INSERT OVERWRITE TABLE dest1 partition(ds='111')
13  SELECT src.value, count(src.key), count(distinct src.key) GROUP BY src.value
14INSERT OVERWRITE TABLE dest2  partition(ds='111')
15  SELECT substr(src.value, 5), count(src.key), count(distinct src.key) GROUP BY substr(src.value, 5);
16
17FROM src
18INSERT OVERWRITE TABLE dest1 partition(ds='111')
19  SELECT src.value, count(src.key), count(distinct src.key) GROUP BY src.value
20INSERT OVERWRITE TABLE dest2  partition(ds='111')
21  SELECT substr(src.value, 5), count(src.key), count(distinct src.key) GROUP BY substr(src.value, 5);
22
23SELECT * from dest1;
24SELECT * from dest2;
25
26
27