Sha256: de46cdafc688a5cb99360ec1a082067db61f02277e8447da61219a24f9da8cb6

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

/*
 * This script filters the pagelinks table, leaving only the pagelinks
 * that terminate within supplied subuniverse.
 * 
 * Output format (same as augment_pagelinks):
 * node_a:int, node_b:int, a_into_b:int, b_into_a:int, is_symmetric:int
 */

%default PAGELINKS         '/data/results/wikipedia/full/pagelinks' -- all edges in the pagelink graph (must be *directed*)
%default SUB_NODES         '/data/results/wikipedia/mini/nodes'     -- all nodes in the subuniverse
%default SUB_PAGELINKS_OUT '/data/results/wikipedia/mini/pagelinks' -- where output will be stored

all_pagelinks = LOAD '$PAGELINKS' AS (from_id:int, into_id:int, 
  from_namespace:int, from_title:chararray,  into_namespace:int, into_title:chararray);
sub_nodes = LOAD '$SUB_NODES' AS (node_id:int);

sub_pagelinks_into = JOIN all_pagelinks BY into_id, sub_nodes BY node_id;
sub_pagelinks = FOREACH sub_pagelinks_into GENERATE
  all_pagelinks::from_id, all_pagelinks::into_id, 
  all_pagelinks::from_namespace, all_pagelinks::from_title,  
  all_pagelinks::into_namespace, all_pagelinks::into_title;
STORE sub_pagelinks INTO '$SUB_PAGELINKS_OUT';

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wukong-3.0.0.pre2 examples/munging/wikipedia/subuniverse/sub_pagelinks_into.pig