You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by yanivG <ya...@gmail.com> on 2014/02/19 13:55:01 UTC

Hbase shell - deletall doesnt remove records

Hi,
We are having a problem with BulkDelete. It appears that it doesn't erase
the desired documents.
Then I move to hbase shell and run delete all <table_name>, <row id> and
still it didn't remove the row.
Any clue why?
Yaniv



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162.html
Sent from the HBase User mailing list archive at Nabble.com.

Re: Hbase shell - deletall doesnt remove records

Posted by Ted Yu <yu...@gmail.com>.
Here is the definition from deleteall.rb :

      def command(table, row, column = nil,
                  timestamp =
org.apache.hadoop.hbase.HConstants::LATEST_TIMESTAMP)

This is what I did:

hbase(main):003:0> deleteall 'IntegrationTestMTTR', '050ux', nil,
1393161606402
0 row(s) in 0.0770 seconds

hbase(main):004:0> get 'IntegrationTestMTTR', '050ux'
COLUMN                                       CELL
0 row(s) in 0.0110 seconds

Cheers


On Sun, Feb 23, 2014 at 1:06 AM, Ron Sher <ro...@gmail.com> wrote:

> But you can only use a timestamp on a specific column, not the whole row.
> Here's the help:
>
> Delete all cells in a given row; pass a table name, row, and optionally
> a column and timestamp. Examples:
>
>   hbase> deleteall 't1', 'r1'
>   hbase> deleteall 't1', 'r1', 'c1'
>   hbase> deleteall 't1', 'r1', 'c1', ts1
>
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162p4056246.html
> Sent from the HBase User mailing list archive at Nabble.com.
>

Re: Hbase shell - deletall doesnt remove records

Posted by Ron Sher <ro...@gmail.com>.
But you can only use a timestamp on a specific column, not the whole row.
Here's the help:

Delete all cells in a given row; pass a table name, row, and optionally
a column and timestamp. Examples:

  hbase> deleteall 't1', 'r1'
  hbase> deleteall 't1', 'r1', 'c1'
  hbase> deleteall 't1', 'r1', 'c1', ts1




--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162p4056246.html
Sent from the HBase User mailing list archive at Nabble.com.

Re: Hbase shell - deletall doesnt remove records

Posted by Ted Yu <yu...@gmail.com>.
In the deleteall command, you can specify a timestamp which is larger than
the custom timestamp.

This way the row would be deleted.

Cheers


On Fri, Feb 21, 2014 at 7:11 AM, Ron Sher <ro...@gmail.com> wrote:

> The timestamp we use is an external version we take from an outside system.
> At first we didn't do that, but that caused issues in which 2 separate
> calls
> reached our system out of order and we ignored their version caused the
> data
> to be written in out of order versions.
> Now we use the outside version number as the timestamp.
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162p4056220.html
> Sent from the HBase User mailing list archive at Nabble.com.
>

Re: Hbase shell - deletall doesnt remove records

Posted by Ron Sher <ro...@gmail.com>.
The timestamp we use is an external version we take from an outside system. 
At first we didn't do that, but that caused issues in which 2 separate calls
reached our system out of order and we ignored their version caused the data
to be written in out of order versions.
Now we use the outside version number as the timestamp.



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162p4056220.html
Sent from the HBase User mailing list archive at Nabble.com.

Re: Hbase shell - deletall doesnt remove records

Posted by Ted Yu <yu...@gmail.com>.
The familyStamp kept by ScanDeleteTracker is of the time when deleteall was
issued.
This value is lower than the large long value given in your example.
Meaning the following check wouldn't pass:

    if (hasFamilyStamp && timestamp <= familyStamp) {

leading to isDeleted() returning DeleteResult.NOT_DELETED. Thus the get
would still return the row.

Can you tell us more about your use case where the large long value is used
?


Cheers


On Thu, Feb 20, 2014 at 1:19 AM, Ron Sher <ro...@gmail.com> wrote:

> I work with Yaniv and we now have a better understanding of the issue.
> It happens when you specifically set a timestamp that is a large long
> value.
> For example 635265926417915010
>
> If you then try to delete the whole line, without specifying the timestamp,
> thinking that it will delete the whole line it simply doesn't work. You get
> no errors, but when you later try to get that line - you get it back.
>
> There is a constant repro:
> Lets say we have a table called t1 with some CF content
>
> put 't1', 'blah', 'content:document', '{}', 635265926417915010
> get 't1', 'blah'
> deleteall 't1', 'blah'
> get 't1', 'blah'
>
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162p4056189.html
> Sent from the HBase User mailing list archive at Nabble.com.
>

Re: Hbase shell - deletall doesnt remove records

Posted by Ron Sher <ro...@gmail.com>.
I work with Yaniv and we now have a better understanding of the issue.
It happens when you specifically set a timestamp that is a large long value.
For example 635265926417915010

If you then try to delete the whole line, without specifying the timestamp,
thinking that it will delete the whole line it simply doesn't work. You get
no errors, but when you later try to get that line - you get it back.

There is a constant repro:
Lets say we have a table called t1 with some CF content

put 't1', 'blah', 'content:document', '{}', 635265926417915010
get 't1', 'blah'
deleteall 't1', 'blah'
get 't1', 'blah'




--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162p4056189.html
Sent from the HBase User mailing list archive at Nabble.com.

Re: Hbase shell - deletall doesnt remove records

Posted by Ted Yu <yu...@gmail.com>.
bq.  delete all <table_name>, <row id>

There is no space between delete and all.

If you can provide more details about the issue you saw, that would be
helpful.

Cheers


On Wed, Feb 19, 2014 at 6:55 AM, yanivG <ya...@gmail.com> wrote:

> Hi,
> We are having a problem with BulkDelete. It appears that it doesn't erase
> the desired documents.
> Then I move to hbase shell and run delete all <table_name>, <row id> and
> still it didn't remove the row.
> Any clue why?
> Yaniv
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162.html
> Sent from the HBase User mailing list archive at Nabble.com.
>

Re: Hbase shell - deletall doesnt remove records

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
can you please give the exact command that you run?

Thanks,

JM


2014-02-19 7:55 GMT-05:00 yanivG <ya...@gmail.com>:

> Hi,
> We are having a problem with BulkDelete. It appears that it doesn't erase
> the desired documents.
> Then I move to hbase shell and run delete all <table_name>, <row id> and
> still it didn't remove the row.
> Any clue why?
> Yaniv
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Hbase-shell-deletall-doesnt-remove-records-tp4056162.html
> Sent from the HBase User mailing list archive at Nabble.com.
>