FROM (
FROM pv_users
SELECT TRANSFORM(pv_users.userid, pv_users.date)
USING 'python mapper.py'
AS dt, uid
CLUSTER BY dt) map_output
INSERT OVERWRITE TABLE pv_users_reduced
SELECT TRANSFORM map_output.dt, map_output.uid
USING 'python reducer.py'
AS date, count;
How map reduce is working in this query and what is the significance of "CLUSTER BY" in this query?