You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Mohammad Tariq <do...@gmail.com> on 2011/12/15 13:25:27 UTC

Creating columns within columns

Hello list,

       I want to store xml files in Hbase and these files may have
tags within tags..And for that I have to create several columns within
a column family..How can I do that..Sorry if my question is
childish..And if that is the case please provide me some link where I
can get the proper info..Many thanks.

Regards,
    Mohammad Tariq

Re: Creating columns within columns

Posted by Mohammad Tariq <do...@gmail.com>.
Hello Michael,

      First of all I would like to thank you for such a good
reply...Yes, you are absolutely right, this was regarding hierarchical
data. Actually we have a web service that collects information from a
server through xml files. Till now we have used Oracle for the
storage. But, since our data is growing exponentially we are planning
to use Hadoop and Hbase for storage and processing...Will it be
appropriate??

Regards,
    Mohammad Tariq



On Thu, Dec 15, 2011 at 9:22 PM, Michael Segel
<mi...@hotmail.com> wrote:
>
> Hi Mohammad,
>
> It sounds like you want to implement a hierarchial data model within HBase. You can do this, albeit there are some drawbacks...
>
> In terms of drawbacks...
> The best example that I can think of is implementing a point of sale solution in Dick Pick's Revelation system.
>
> Here you store each PoS entry as a single row. So you end up storing the customer id, ship to: Address, bill to: Address, Line Items, sub total, sales tax, total ... that sort of thing.
> Inside things like ship to: Address you have fields : Street 1, Street 2, City, State, Zip
> Line Items is an array of lines which have sku, description, qty, Unit price , total price.
>
> So you get the idea.
> There are several ways of packaging this data within Hadoop/HBase ... xml, json, avro, etc ...
>
> The downside to this is that if you want to try and find out which product was the most popular that week, you've got to pull out each record, pull out and aggreate the data and return the result.
> In this example, you have to do more work than you would if you were implementing it in a relational model.
> Its an extremely valid approach.
>
> I've seen some actually take their java objects use Avro and put it directly in to HBase. It makes it hard to search on and filter on, but still a valid approach.
>
> HTH
>
> -Mike
>
>
>> From: dontariq@gmail.com
>> Date: Thu, 15 Dec 2011 20:06:33 +0530
>> Subject: Re: Creating columns within columns
>> To: user@hbase.apache.org
>>
>> Hello Doug,
>>     Thanks a lot for the links.
>>
>> Regards,
>>     Mohammad Tariq
>>
>>
>>
>> On Thu, Dec 15, 2011 at 7:34 PM, Doug Meil
>> <do...@explorysmedical.com> wrote:
>> >
>> > Hi there-
>> >
>> > See...
>> >
>> > http://hbase.apache.org/book.html#supported.datatypes
>> >
>> > http://hbase.apache.org/book.html#datamodel
>> >
>> > ... Hbase is "bytes-in bytes-out" in terms of what it stores.
>> >
>> >
>> >
>> >
>> > On 12/15/11 7:25 AM, "Mohammad Tariq" <do...@gmail.com> wrote:
>> >
>> >>Hello list,
>> >>
>> >>       I want to store xml files in Hbase and these files may have
>> >>tags within tags..And for that I have to create several columns within
>> >>a column family..How can I do that..Sorry if my question is
>> >>childish..And if that is the case please provide me some link where I
>> >>can get the proper info..Many thanks.
>> >>
>> >>Regards,
>> >>    Mohammad Tariq
>> >>
>> >
>> >
>

RE: Creating columns within columns

Posted by Michael Segel <mi...@hotmail.com>.
Hi Mohammad,

It sounds like you want to implement a hierarchial data model within HBase. You can do this, albeit there are some drawbacks...

In terms of drawbacks...
The best example that I can think of is implementing a point of sale solution in Dick Pick's Revelation system.

Here you store each PoS entry as a single row. So you end up storing the customer id, ship to: Address, bill to: Address, Line Items, sub total, sales tax, total ... that sort of thing.
Inside things like ship to: Address you have fields : Street 1, Street 2, City, State, Zip
Line Items is an array of lines which have sku, description, qty, Unit price , total price.

So you get the idea. 
There are several ways of packaging this data within Hadoop/HBase ... xml, json, avro, etc ...

The downside to this is that if you want to try and find out which product was the most popular that week, you've got to pull out each record, pull out and aggreate the data and return the result. 
In this example, you have to do more work than you would if you were implementing it in a relational model. 
Its an extremely valid approach. 

I've seen some actually take their java objects use Avro and put it directly in to HBase. It makes it hard to search on and filter on, but still a valid approach.

HTH

-Mike


> From: dontariq@gmail.com
> Date: Thu, 15 Dec 2011 20:06:33 +0530
> Subject: Re: Creating columns within columns
> To: user@hbase.apache.org
> 
> Hello Doug,
>     Thanks a lot for the links.
> 
> Regards,
>     Mohammad Tariq
> 
> 
> 
> On Thu, Dec 15, 2011 at 7:34 PM, Doug Meil
> <do...@explorysmedical.com> wrote:
> >
> > Hi there-
> >
> > See...
> >
> > http://hbase.apache.org/book.html#supported.datatypes
> >
> > http://hbase.apache.org/book.html#datamodel
> >
> > ... Hbase is "bytes-in bytes-out" in terms of what it stores.
> >
> >
> >
> >
> > On 12/15/11 7:25 AM, "Mohammad Tariq" <do...@gmail.com> wrote:
> >
> >>Hello list,
> >>
> >>       I want to store xml files in Hbase and these files may have
> >>tags within tags..And for that I have to create several columns within
> >>a column family..How can I do that..Sorry if my question is
> >>childish..And if that is the case please provide me some link where I
> >>can get the proper info..Many thanks.
> >>
> >>Regards,
> >>    Mohammad Tariq
> >>
> >
> >
 		 	   		  

Re: Creating columns within columns

Posted by Mohammad Tariq <do...@gmail.com>.
Hello Doug,
    Thanks a lot for the links.

Regards,
    Mohammad Tariq



On Thu, Dec 15, 2011 at 7:34 PM, Doug Meil
<do...@explorysmedical.com> wrote:
>
> Hi there-
>
> See...
>
> http://hbase.apache.org/book.html#supported.datatypes
>
> http://hbase.apache.org/book.html#datamodel
>
> ... Hbase is "bytes-in bytes-out" in terms of what it stores.
>
>
>
>
> On 12/15/11 7:25 AM, "Mohammad Tariq" <do...@gmail.com> wrote:
>
>>Hello list,
>>
>>       I want to store xml files in Hbase and these files may have
>>tags within tags..And for that I have to create several columns within
>>a column family..How can I do that..Sorry if my question is
>>childish..And if that is the case please provide me some link where I
>>can get the proper info..Many thanks.
>>
>>Regards,
>>    Mohammad Tariq
>>
>
>

Re: Creating columns within columns

Posted by Doug Meil <do...@explorysmedical.com>.
Hi there-

See...

http://hbase.apache.org/book.html#supported.datatypes

http://hbase.apache.org/book.html#datamodel

... Hbase is "bytes-in bytes-out" in terms of what it stores.




On 12/15/11 7:25 AM, "Mohammad Tariq" <do...@gmail.com> wrote:

>Hello list,
>
>       I want to store xml files in Hbase and these files may have
>tags within tags..And for that I have to create several columns within
>a column family..How can I do that..Sorry if my question is
>childish..And if that is the case please provide me some link where I
>can get the proper info..Many thanks.
>
>Regards,
>    Mohammad Tariq
>