/tags/release-0.0.0-rc0/hive/external/ql/src/test/queries/clientpositive/mapreduce4.q
text | 20 lines | 15 code | 5 blank | 0 comment | 0 complexity | 39924c020fd4f7c1750b911ad55d39df MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
- CREATE TABLE dest1(key INT, ten INT, one INT, value STRING) STORED AS TEXTFILE;
- EXPLAIN
- FROM src
- INSERT OVERWRITE TABLE dest1
- MAP src.key, CAST(src.key / 10 AS INT), CAST(src.key % 10 AS INT), src.value
- USING '/bin/cat' AS (tkey, ten, one, tvalue)
- DISTRIBUTE BY tvalue, tkey
- SORT BY ten DESC, one ASC;
- FROM src
- INSERT OVERWRITE TABLE dest1
- MAP src.key, CAST(src.key / 10 AS INT), CAST(src.key % 10 AS INT), src.value
- USING '/bin/cat' AS (tkey, ten, one, tvalue)
- DISTRIBUTE BY tvalue, tkey
- SORT BY ten DESC, one ASC;
- SELECT dest1.* FROM dest1;