PageRenderTime 52ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. CREATE TABLE dest1(key INT, ten INT, one INT, value STRING) STORED AS TEXTFILE;
  2. EXPLAIN
  3. FROM src
  4. INSERT OVERWRITE TABLE dest1
  5. MAP src.key, CAST(src.key / 10 AS INT), CAST(src.key % 10 AS INT), src.value
  6. USING '/bin/cat' AS (tkey, ten, one, tvalue)
  7. DISTRIBUTE BY tvalue, tkey
  8. SORT BY ten DESC, one ASC;
  9. FROM src
  10. INSERT OVERWRITE TABLE dest1
  11. MAP src.key, CAST(src.key / 10 AS INT), CAST(src.key % 10 AS INT), src.value
  12. USING '/bin/cat' AS (tkey, ten, one, tvalue)
  13. DISTRIBUTE BY tvalue, tkey
  14. SORT BY ten DESC, one ASC;
  15. SELECT dest1.* FROM dest1;