hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramasubramanian Narayanan <ramasubramanian.naraya...@gmail.com>
Subject How to use put command in Java for dynamic field name creation
Date Thu, 07 Feb 2013 15:49:31 GMT

I have a requirement to create dynamic field name (based on value of a
column)  at run time... I think this is the usual approach that we will
used in HBASE for one to many relationships..

For example, physical table has the following structure

  *Branch Number* *Branch Name* *Supported Currency Code* *Currency Name*  1
ABC INR India Rupee  1 ABC USD US Dollar  2 EFG SGD Singapore Dollar  2 EFG
INR India Rupee
Row key is Branch Number...

To flatten it out, we have to redesign the HBASE table as follows :

The fields related to currency will be grouped and created under a single
field (supported currency code & currency name) and the field name is
dynamically created as "CCY"+<actual value for supported currency code>

For the above scenario, the HBASE table will look llike following...

  *Branch Number* *Branch Name* *CCY_INR* *CCY_USD* *CCY_SGD*  1 ABC INR|India
Rupee USD|US Dollar
 2 EFG INR|India Rupee
SGD|Singapore Dollar
Now the question is,

what is the syntax for the put statement in JAVA so that the Column name is
dynamically created...

put ('branch','1','cf1:'+'CCY'+<valueof currency field>,<value of currency
field>+<value of currency name field>);

the above sytax is not working for me...

Please let me know the syntax of the put statement in this scenario using


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message