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

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

#
text | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | 39f6a63c2ea1903f738679e16f764ded MD5 | raw file
 1set hive.map.aggr=false;
 2set hive.groupby.skewindata=false;
 3
 4CREATE TABLE dest1(key STRING, c1 INT, c2 STRING) STORED AS TEXTFILE;
 5
 6EXPLAIN EXTENDED
 7FROM srcpart src
 8INSERT OVERWRITE TABLE dest1 
 9SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) 
10WHERE src.ds = '2008-04-08'
11GROUP BY substr(src.key,1,1);
12
13FROM srcpart src
14INSERT OVERWRITE TABLE dest1 
15SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) 
16WHERE src.ds = '2008-04-08'
17GROUP BY substr(src.key,1,1);
18
19SELECT dest1.* FROM dest1;