aboutsummaryrefslogtreecommitdiffstats
path: root/pig/hbase-count-rows.pig
blob: 57e83a5e438169a6c45c8f2d7892174c44e4ebec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

REGISTER /usr/lib/hbase/lib/hbase-client-0.98.6-cdh5.3.1.jar
REGISTER /usr/lib/hbase/lib/hbase-common-0.98.6-cdh5.3.1.jar
REGISTER /usr/lib/hbase/lib/hbase-hadoop2-compat-0.98.6-cdh5.3.1.jar
REGISTER /usr/lib/hbase/lib/hbase-protocol-0.98.6-cdh5.3.1.jar

set hbase.zookeeper.quorum 'mtrcs-zk1.us.archive.org,mtrcs-zk2.us.archive.org,mtrcs-zk3.us.archive.org'

data = LOAD 'hbase://wbgrp-journal-extract-0-qa'
       USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('grobid0:status_code', '-loadKey true')
       AS (key:CHARARRAY, status:CHARARRAY);

data_group = GROUP data ALL;
data_count = FOREACH data_group GENERATE COUNT(data);
DUMP data_count;