You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Krishna Kalyan <kr...@gmail.com> on 2014/10/21 14:29:15 UTC

Duplicate Value Inserts in HBase

Hi,
I have a HBase table which is populated from pig using PigStorage.
While inserting, suppose for rowkey i have a duplicate value.
Is there a way to prevent an update?.
I want to maintain the version history for my values which are unique.

Regards,
Krishna

Re: Duplicate Value Inserts in HBase

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
You can do check and puts to validate if value is already there, but it's
slower...

2014-10-21 8:50 GMT-04:00 Krishna Kalyan <kr...@gmail.com>:

> Thanks Jean,
> If i put the same value in my table for a particular column for a rowkey i
> want HBase reject this value and retain old value with old time stamp.
> In other words update only when value changes.
>
> Regards,
> Krishna
>
> On Tue, Oct 21, 2014 at 6:02 PM, Jean-Marc Spaggiari <
> jean-marc@spaggiari.org> wrote:
>
> > Hi Krishna,
> >
> > HBase will store them in the same row, same cell but you will have 2
> > versions. If you want to keep just one, setup the version=1 on the table
> > side and only one will be stored. Is that what yo mean?
> >
> > JM
> >
> > 2014-10-21 8:29 GMT-04:00 Krishna Kalyan <kr...@gmail.com>:
> >
> > > Hi,
> > > I have a HBase table which is populated from pig using PigStorage.
> > > While inserting, suppose for rowkey i have a duplicate value.
> > > Is there a way to prevent an update?.
> > > I want to maintain the version history for my values which are unique.
> > >
> > > Regards,
> > > Krishna
> > >
> >
>

Re: Duplicate Value Inserts in HBase

Posted by Krishna Kalyan <kr...@gmail.com>.
Thanks Jean,
If i put the same value in my table for a particular column for a rowkey i
want HBase reject this value and retain old value with old time stamp.
In other words update only when value changes.

Regards,
Krishna

On Tue, Oct 21, 2014 at 6:02 PM, Jean-Marc Spaggiari <
jean-marc@spaggiari.org> wrote:

> Hi Krishna,
>
> HBase will store them in the same row, same cell but you will have 2
> versions. If you want to keep just one, setup the version=1 on the table
> side and only one will be stored. Is that what yo mean?
>
> JM
>
> 2014-10-21 8:29 GMT-04:00 Krishna Kalyan <kr...@gmail.com>:
>
> > Hi,
> > I have a HBase table which is populated from pig using PigStorage.
> > While inserting, suppose for rowkey i have a duplicate value.
> > Is there a way to prevent an update?.
> > I want to maintain the version history for my values which are unique.
> >
> > Regards,
> > Krishna
> >
>

Re: Duplicate Value Inserts in HBase

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
Hi Krishna,

HBase will store them in the same row, same cell but you will have 2
versions. If you want to keep just one, setup the version=1 on the table
side and only one will be stored. Is that what yo mean?

JM

2014-10-21 8:29 GMT-04:00 Krishna Kalyan <kr...@gmail.com>:

> Hi,
> I have a HBase table which is populated from pig using PigStorage.
> While inserting, suppose for rowkey i have a duplicate value.
> Is there a way to prevent an update?.
> I want to maintain the version history for my values which are unique.
>
> Regards,
> Krishna
>