-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraph_sng_test.pig
executable file
·24 lines (19 loc) · 1.03 KB
/
graph_sng_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
/* 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 a Single Table graph
* 3. Load results from a single, hard-coded graph (SimpleSngInsertTestSingle) (Single is automatically added in Graphulo 1.0)
* 4. Dump the first ten rows from the graph
*
*/
REGISTER graphulo-pig.jar
-- Load file into Graphulo
A = LOAD 'insertSngInput.txt' USING PigStorage(',') AS (inputFile:chararray, graphName:chararray);
B = FOREACH A GENERATE edu.mit.ll.graphulo.pig.backend.InsertSingleTableGraph('config/localAccumulo.config',inputFile,graphName);
DUMP A;
DUMP B;
-- Read the graph from Graphulo using Accumulo default LOAD function
raw = LOAD 'accumulo://SimpleSngInsertTestSingle?instance=graphuloLocal&user=root&password=graphuloLocal&zookeepers=localhost'
USING org.apache.pig.backend.hadoop.accumulo.AccumuloStorage('*', '') AS (row:chararray, columns:map[]);
raw = LIMIT raw 10;
DUMP raw;