Support Questions
Find answers, ask questions, and share your expertise

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