Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Failed to load latest commit information.
src/main Remove unnecessary import statements
1.csv Add a CSV file Update
pom.xml Commit src files
test.pig Fix Pig script


An example of how to bulk import data from Avro files into a HBase table.

In this example, I do the following:

1. Load a CSV file with PigStorage and store data as an Avro file using AvroStorage.
2. Launch a MR job that loads the Avro file and dump HFile
3. Do bulkload HFile into HBase

CSV file


Avro schema

  "type" : "record",
  "name" : "r",
  "fields" : [ {
    "name" : "f1",
    "type" : "bytes"
  }, {
    "name" : "f2",
    "type" : "bytes"
  } ]

HBase columns

cf:f1, cf:f2


1. service hbase-master start // use hbase in standalone mode
2. hbase shell
    a. create 'foo', {NAME => 'cf'} 
3. hadoop fs -copyFromLocal 1.csv
4. pig test.pig
5. hbase shell
    a. scan 'foo'
Something went wrong with that request. Please try again.