Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

how to append row key in Hbase using KeyValue class of Hfile ?

Explorer

I am trying to create HFiles from csv using Java and while trying to write Hfile row keys aren't getting appended and I get 0.1 kb hfile with generic Hfile information.

12 REPLIES 12

Super Collaborator

Explorer

I get an empty Hfile created from the csv it takes as an input..

Super Collaborator

Can you take a look at

hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java

getNewWriter() shows you how to create StoreFile.Writer

Explorer

May I know the dependency library for that

Super Collaborator

HFileOutputFormat2 is in hbase-server in hbase 1.1.x

The mvn dependency:tree output for hbase-server is 200 lines long.

You can get the output yourself (for your project). If you encounter problem, let me know.

Explorer

I am working on it. Thank you Ted!!

Explorer

Any idea how to give Hfile as an input to Hbase table

Super Collaborator

hfile can be loaded thru bulk load.

Explorer

bulkload is again using Java API or Do we have any jars that can simply take an Hfile and table through command line and create the table

Super Collaborator

Explorer

I tried for finding Hbase-version jar that was mentioned in the link above and I no where find that jar which has completebulkload class..please help

Super Collaborator

From hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java :

public static final String NAME = "completebulkload";

This class is in hbase-server jar

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.