You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Erman Pattuk <er...@gmail.com> on 2012/10/09 19:04:24 UTC
Problem with Rest Java Client
Hi,
I have started using HBase Rest Java client as a part of my project. I
see that it may have a problem with the Delete operation.
For a given Delete object, if you apply deleteColumn(family, qualifier)
on it, all matching qualifiers are deleted instead of the latest
value.
In order to recreate the problem:
1 - Create table tab1, with family fam1.
2 - Through shell, insert two values, as:
row1, fam1, q1, val1
row1, fam1, q1, val2
3 - Through Rest Java client:
Delete delItem = new Delete(Bytes.toBytes("row1"));
delItem.deleteColumn(Bytes.toBytes("fam1"), Bytes.toBytes("q1"));
table.delete(delItem);
4 - All q1 values are deleted, instead of the latest q1 value, which is
val2.
Is that an expected result?
Thanks,
Erman
Re: Problem with Rest Java Client
Posted by Erman Pattuk <er...@gmail.com>.
This link was very helpful.
Thank you all guys.
Erman
On 10/12/2012 4:45 PM, Jerry Lam wrote:
> Hi Erman:
>
> I think this post summed up very well about deletion in hbase (
> http://hadoop-hbase.blogspot.ca/2011/12/deletion-in-hbase.html) Please have
> a look.
>
> If you need to delete a specific version of a cell, you can use version
> delete marker as described in the post.
>
> Best Regards,
>
> Jerry
>
> On Tue, Oct 9, 2012 at 1:24 PM, Jean-Marc Spaggiari <jean-marc@spaggiari.org
>> wrote:
>> Hi Erman,
>>
>> It's normal.
>>
>> At t=1 you insert val1
>> At t=2 you insert val2
>> At t=3 you put a marker that row1:farm1:q1 values are deleted.
>>
>> When you try to read the values, HBase will hide all that is before
>> t=3 because of the marker. Which mean you will not see val2 neither
>> you will see val1.
>>
>> I think you can still see them if you read ALL the version for the row.
>>
>> JM
>>
>> 2012/10/9, Erman Pattuk <er...@gmail.com>:
>>> Hi,
>>>
>>> I have started using HBase Rest Java client as a part of my project. I
>>> see that it may have a problem with the Delete operation.
>>> For a given Delete object, if you apply deleteColumn(family, qualifier)
>>> on it, all matching qualifiers are deleted instead of the latest
>>> value.
>>>
>>> In order to recreate the problem:
>>>
>>> 1 - Create table tab1, with family fam1.
>>> 2 - Through shell, insert two values, as:
>>> row1, fam1, q1, val1
>>> row1, fam1, q1, val2
>>> 3 - Through Rest Java client:
>>> Delete delItem = new Delete(Bytes.toBytes("row1"));
>>> delItem.deleteColumn(Bytes.toBytes("fam1"), Bytes.toBytes("q1"));
>>> table.delete(delItem);
>>> 4 - All q1 values are deleted, instead of the latest q1 value, which is
>>> val2.
>>>
>>> Is that an expected result?
>>>
>>> Thanks,
>>> Erman
>>>
Re: Problem with Rest Java Client
Posted by Jerry Lam <ch...@gmail.com>.
Hi Erman:
I think this post summed up very well about deletion in hbase (
http://hadoop-hbase.blogspot.ca/2011/12/deletion-in-hbase.html) Please have
a look.
If you need to delete a specific version of a cell, you can use version
delete marker as described in the post.
Best Regards,
Jerry
On Tue, Oct 9, 2012 at 1:24 PM, Jean-Marc Spaggiari <jean-marc@spaggiari.org
> wrote:
> Hi Erman,
>
> It's normal.
>
> At t=1 you insert val1
> At t=2 you insert val2
> At t=3 you put a marker that row1:farm1:q1 values are deleted.
>
> When you try to read the values, HBase will hide all that is before
> t=3 because of the marker. Which mean you will not see val2 neither
> you will see val1.
>
> I think you can still see them if you read ALL the version for the row.
>
> JM
>
> 2012/10/9, Erman Pattuk <er...@gmail.com>:
> > Hi,
> >
> > I have started using HBase Rest Java client as a part of my project. I
> > see that it may have a problem with the Delete operation.
> > For a given Delete object, if you apply deleteColumn(family, qualifier)
> > on it, all matching qualifiers are deleted instead of the latest
> > value.
> >
> > In order to recreate the problem:
> >
> > 1 - Create table tab1, with family fam1.
> > 2 - Through shell, insert two values, as:
> > row1, fam1, q1, val1
> > row1, fam1, q1, val2
> > 3 - Through Rest Java client:
> > Delete delItem = new Delete(Bytes.toBytes("row1"));
> > delItem.deleteColumn(Bytes.toBytes("fam1"), Bytes.toBytes("q1"));
> > table.delete(delItem);
> > 4 - All q1 values are deleted, instead of the latest q1 value, which is
> > val2.
> >
> > Is that an expected result?
> >
> > Thanks,
> > Erman
> >
>
Re: Problem with Rest Java Client
Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
Hi Erman,
It's normal.
At t=1 you insert val1
At t=2 you insert val2
At t=3 you put a marker that row1:farm1:q1 values are deleted.
When you try to read the values, HBase will hide all that is before
t=3 because of the marker. Which mean you will not see val2 neither
you will see val1.
I think you can still see them if you read ALL the version for the row.
JM
2012/10/9, Erman Pattuk <er...@gmail.com>:
> Hi,
>
> I have started using HBase Rest Java client as a part of my project. I
> see that it may have a problem with the Delete operation.
> For a given Delete object, if you apply deleteColumn(family, qualifier)
> on it, all matching qualifiers are deleted instead of the latest
> value.
>
> In order to recreate the problem:
>
> 1 - Create table tab1, with family fam1.
> 2 - Through shell, insert two values, as:
> row1, fam1, q1, val1
> row1, fam1, q1, val2
> 3 - Through Rest Java client:
> Delete delItem = new Delete(Bytes.toBytes("row1"));
> delItem.deleteColumn(Bytes.toBytes("fam1"), Bytes.toBytes("q1"));
> table.delete(delItem);
> 4 - All q1 values are deleted, instead of the latest q1 value, which is
> val2.
>
> Is that an expected result?
>
> Thanks,
> Erman
>