diff options
author | Lester Solbakken <lesters@yahoo-inc.com> | 2017-03-17 12:29:41 +0100 |
---|---|---|
committer | Lester Solbakken <lesters@yahoo-inc.com> | 2017-03-17 12:29:41 +0100 |
commit | ef775d57f273a69f0de2cd52518cbd9260e55eac (patch) | |
tree | 5b89780e05f24c70b0158968fda5225822df9933 /vespa-hadoop/src/test/pig/feed_create_operations.pig | |
parent | b09d7deb64e5a723c5a052dd2b1db225f632405f (diff) |
Renamce hadoop -> vespa-hadoop
Diffstat (limited to 'vespa-hadoop/src/test/pig/feed_create_operations.pig')
-rw-r--r-- | vespa-hadoop/src/test/pig/feed_create_operations.pig | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vespa-hadoop/src/test/pig/feed_create_operations.pig b/vespa-hadoop/src/test/pig/feed_create_operations.pig new file mode 100644 index 00000000000..2186935b59a --- /dev/null +++ b/vespa-hadoop/src/test/pig/feed_create_operations.pig @@ -0,0 +1,23 @@ +-- REGISTER vespa-hadoop.jar -- Not needed in tests + +-- Create valid Vespa put operations +DEFINE VespaPutOperation + com.yahoo.vespa.hadoop.pig.VespaDocumentOperation( + 'operation=put', + 'docid=id:<application>:metrics::<name>-<date>' + ); + +-- By default, VespaStorage assumes it's feeding valid Vespa operations +DEFINE VespaStorage + com.yahoo.vespa.hadoop.pig.VespaStorage(); + +-- Load tabular data +metrics = LOAD 'src/test/resources/tabular_data.csv' AS (date:chararray, name:chararray, value:int, application:chararray); + +-- Transform tabular data to a Vespa document operation JSON format +metrics = FOREACH metrics GENERATE VespaPutOperation(*); + +-- Store into Vespa +STORE metrics INTO '$ENDPOINT' USING VespaStorage(); + + |