You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Vijay <vi...@gmail.com> on 2009/06/01 05:33:43 UTC

Re: Insert in Hbase - begginer/basic question

Thanks Stack that helped!..... Another question (this will clarify most of
my confusions), can we create index on the subcolumns? and will it be
optimal if we are searching for the items in the column family?

like the index on columnFamily:colum1
and columnFamily:colum1:subcol2
 .... I am asking this to know if i can logically seperate it....

Thanks and Regards,
</VJ>




On Sat, May 30, 2009 at 2:05 PM, stack <st...@duboce.net> wrote:

> The below looks fine.  Its the only way to do multiple columns per row.
> St.Ack
>
> On Fri, May 29, 2009 at 11:30 AM, Vijay <vi...@gmail.com> wrote:
>
> > Hi,
> > Have a question, I see the hbase shell allows me to create multiple
> > columns... is it optimal for me to insert a small set of data in every
> row
> > and scale it to billions of row? the problem is the query can be on any
> > column/ column's....
> > i was planning to update the following table. with 15 rows and i wanted
> to
> > update those in batch and retive it.... is the following syntax on my
> java
> > program right?
> >
> >
> >       HBaseConfiguration config = new HBaseConfiguration();
> >        HTable tab = new HTable(config, "xxxxxxxxx");
> >        BatchUpdate batchUpdate = new BatchUpdate();
> >        batchUpdate.put("col1", val1);
> >        batchUpdate.put("col2", val2);
> >        batchUpdate.put("col3", val3);
> >        batchUpdate.put("col4", val4);
> >        batchUpdate.put("col5", val5);
> > ...........................
> >        lst.add(batchUpdate);
> >        tab.commit(lst);
> >
> > Basically i wanted to know if this is optimal.... or should i design my
> > data
> > in some other way? I am kind of confused because i read diffrent kinds of
> > things everyday abt doing it :)
> >
> > Thanks a lot for the help....
> >
> > Regards,
> > </VJ>
> >
>