Commit 9544dba8 authored by leroyq's avatar leroyq

exo3

parent 75f768ee
-- TODO: load the input dataset, located in ./local-input/OSN/tw.txt
A = LOAD './tw.txt' AS (id: long, fr: long);
B = A AS (id2: long, fr2: long);
B = FOREACH A GENERATE *;
-- TODO: compute all the two-hop paths
twohop = JOIN A BY fr B BY id2;
twohop = JOIN A BY $1 B BY $0;
-- TODO: project the twohop relation such that in output you display only the start and end nodes of the two hop path
p_result = FOREACH twohop GENERATE id, fr2;
p_result = FOREACH twohop GENERATE $0, $3;
-- TODO: make sure you avoid loops (e.g., if user 12 and 13 follow eachother)
result = FILTER p_result BY (id!=fr2);
......
-- TODO: load the input dataset, located in ./local-input/OSN/tw.txt
A = LOAD './tw.txt' AS (id: long, fr: long);
B = A AS (id2: long, fr2: long);
B = FOREACH A GENERATE *;
-- TODO: compute all the two-hop paths
twohop = JOIN A by fr B by id;
twohop = JOIN A BY fr B BY $2;
-- TODO: project the twohop relation such that in output you display only the start and end nodes of the two hop path
p_result = FOREACH GENERATE
p_result = FOREACH twohop GENERATE id, $2;
-- TODO: make sure you avoid loops (e.g., if user 12 and 13 follow eachother)
--result = FILTER ...
result = FILTER p_result BY (id!=fr2);
STORE result INTO './local-output/OSN/twj/';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment