0

Thanks for taking interest in my question. Before I begin, I'd like to let you know that I'm very new to Hadoop & HBase. So far, I find Hadoop very interesting and would like to contribute more in the future.

I'm primarily interested in improving performance of HBase. To do so,I had created one hbase table , and have written pig script for the loading 5000(only values delimited by '!' ) lines of data into hbase table and later i mapped this h base table with Hive table . every thing is working fine as of now ... But the problem comes now is i want to load the data which has key and value both (for example key1 =12 ! key2= 13) , so for that what kind of parsing i can choose to load that key-value pair data into h base tables accordingly , and also please let me know the importance of the row key in h base table .

And i had written the Pig script as follows

A = LOAD '/BULK_ARK_DATA/' USING PigStorage( '!' ) AS(id: chararray,a: chararray,b: chararray,c: chararray); STORE A INTO 'hbase://bulk_ark' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage ( 'AF:a AF:b AF:c');

So how to Load the key-valued data in hbase tables ?????? Please respond me As early as u get this .... :)

MapReddy Usthili
  • 288
  • 1
  • 7
  • 23

1 Answers1

0

Hbase is actually a key-value datastore(a map at its core). You don't have to do anything special, but think well about your table schema. For your particular case, how about having the first part of you datum as the key and the second part as value. Something like "cf:key1=>12"

Tariq
  • 34,076
  • 8
  • 57
  • 79
  • Thanx Tariq :) yeah i agree with you, but have one doubt here if i gets different different key-values in each of the line , in that case how to write a select Query for particular value ? Let me explain in detail for example File test.ark contains 1) key=12! name=test 2) value=14!id=345 3)true=yes So Now if we want to write qury for "id" then how to write query for "id" ??? if u not aware that id key has it's entry in only 2 nd line . apologies from my side If am wrong in point of actual view – MapReddy Usthili Dec 24 '12 at 06:10
  • you can use column qualifier filter and get the 'id' column directly, from all the rows, wherever it is present. – Tariq Dec 24 '12 at 07:43