PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
text | 17 lines | 13 code | 4 blank | 0 comment | 0 complexity | e752b26028c9d726cfcbb1e2231a39da MD5 | raw file
 1CREATE TABLE dest1(key INT, ten INT, one INT, value STRING) STORED AS TEXTFILE;
 2
 3EXPLAIN
 4FROM src
 5INSERT OVERWRITE TABLE dest1
 6SELECT src.key, CAST(src.key / 10 AS INT) as c2, CAST(src.key % 10 AS INT) as c3, src.value
 7DISTRIBUTE BY value, key
 8SORT BY c2 DESC, c3 ASC;
 9
10
11FROM src
12INSERT OVERWRITE TABLE dest1
13SELECT src.key, CAST(src.key / 10 AS INT) as c2, CAST(src.key % 10 AS INT) as c3, src.value
14DISTRIBUTE BY value, key
15SORT BY c2 DESC, c3 ASC;
16
17SELECT dest1.* FROM dest1;