One Star

HBase interaction when the Schema has dynamically named columns?

In HBase, the most common way to establish relationships in data is to do so through the use of dynamically named columns.
Take an Entity "Foo" with Attributes "A,B,C" and an Entity "Bar" with attributes "X,Y,Z". To establish a 1:M relationship in an RDBMS, there would be two tables, Foo and Bar, with a foreign key in Bar linking back to a column in Foo.
However, in HBase, there would only be one table, with one or two column families. For simplicity, lets call the table FooBar and have two column families, Foo and Bar, and the column/column families would look like this:
Foo:A,Foo:B, Foo:C, Bar:1|x,Bar:1|y, Bar:1|z, Bar:2|x, Bar:2|y, Bar:3|z, ... Bar:n|1, Bar:n|2, Bar:n|3
Each row in this table could have any number of columns in the Bar column family, and they could be named anything in the format of Bar:<>|x, Bar:<>|y, or Bar:<>|z, where <> would be the identifying value of the particular bar Entity under discussion.
How may I use the tHBase* components to establish this?
Thank you.
1 REPLY
Four Stars

Re: HBase interaction when the Schema has dynamically named columns?

Hi,
Try this, we can extend if you get some hint that it is possible...
- Use two tHbaseInput component to read Foo and Bar
- Use tMap and combine all the columns from both the tables using string concatenation into single column
- Use tHbaseOutput to insert this single column to database
Post your design logic and problems if you face any...
Vaibhav