Created
September 7, 2012 05:24
-
-
Save anonymous/3663417 to your computer and use it in GitHub Desktop.
Hive streaming mapreduce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS tim_hive_r_demo_new; | |
CREATE TABLE tim_hive_r_demo_new ( | |
users double, | |
rating double) | |
ROW FORMAT DELIMITED | |
FIELDS TERMINATED BY '\t'; | |
add FILE map.R; | |
add FILE reduce.R; | |
FROM | |
( | |
map users, rating, grp | |
using 'map.R' | |
as users, rating, grp | |
FROM my_hive_r_demo | |
cluster by users | |
) a | |
INSERT OVERWRITE TABLE tim_hive_r_demo_new | |
reduce a.users, a.rating | |
USING 'reduce.R' | |
AS users, rating; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment