-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraph_inc_test.pig
executable file
·26 lines (21 loc) · 1007 Bytes
/
graph_inc_test.pig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* This script (roughly) demonstrates the following:
*
* 1. Load a file consisting of comma separated values for input data and graph names (/path/to/file,graphName)
* 2. Insert all the information into Graphulo as Adjacency graphs
* 3. Load results from a single, hard-coded graph (SimpleAdjInsertTest)
* 4. Dump the first ten rows from the graph
*
*/
REGISTER graphulo-pig.jar
-- Load file into Graphulo
A = LOAD 'insertIncInput.txt' USING PigStorage(',') AS (inputFile:chararray, graphName:chararray);
B = FOREACH A GENERATE edu.mit.ll.graphulo.pig.backend.InsertIncidenceGraph('config/localAccumulo.config',inputFile,graphName);
DUMP A;
DUMP B;
-- Read the graph from Graphulo using Accumulo default LOAD function
raw = LOAD 'accumulo://SimpleIncInsertTest?instance=graphuloLocal&user=root&password=graphuloLocal&zookeepers=localhost'
USING org.apache.pig.backend.hadoop.accumulo.AccumuloStorage(
'*', '') AS
(vertex:chararray, links:map[]);
raw = LIMIT raw 10;
DUMP raw;