You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jeff Zhang <zj...@gmail.com> on 2010/08/20 03:52:15 UTC

How to delete a range of table ?

Hi all,

I'd like to delete a range of table, but could not find a convenient
api. One work around is first scan the range of table and then invoke
delete operation for each row. This seems not so good, is there any
other methods for this purpose ?


-- 
Best Regards

Jeff Zhang

Re: How to delete a range of table ?

Posted by Jeff Zhang <zj...@gmail.com>.
Bosch,

I am still using the naive method: first getting the key by invoking
get operaption with scan range, and then delete each key.
This method will invovle lots of round trip between client and server,
so perfomrnace won't be good, but it works for me (I currently do not
care about the performance). But I belived it has room to be improved
(doing deletion range in server side will be better)



On Fri, Sep 10, 2010 at 2:47 AM, Raimon Bosch <ra...@gmail.com> wrote:
>
>
> Hi Jeff,
>
> Have you solved this issue? We are working in a implementation in HBase and
> we need to do a range delete (using the key).
>
> Regards,
> Raimon Bosch.
>
>
> Jeff Zhang-4 wrote:
>>
>> Hi all,
>>
>> I'd like to delete a range of table, but could not find a convenient
>> api. One work around is first scan the range of table and then invoke
>> delete operation for each row. This seems not so good, is there any
>> other methods for this purpose ?
>>
>>
>> --
>> Best Regards
>>
>> Jeff Zhang
>>
>>
>
> --
> View this message in context: http://old.nabble.com/How-to-delete-a-range-of-table---tp29488100p29675155.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>



-- 
Best Regards

Jeff Zhang

Re: How to delete a range of table ?

Posted by Raimon Bosch <ra...@gmail.com>.

Hi Jeff,

Have you solved this issue? We are working in a implementation in HBase and
we need to do a range delete (using the key).

Regards,
Raimon Bosch.


Jeff Zhang-4 wrote:
> 
> Hi all,
> 
> I'd like to delete a range of table, but could not find a convenient
> api. One work around is first scan the range of table and then invoke
> delete operation for each row. This seems not so good, is there any
> other methods for this purpose ?
> 
> 
> -- 
> Best Regards
> 
> Jeff Zhang
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-delete-a-range-of-table---tp29488100p29675155.html
Sent from the HBase User mailing list archive at Nabble.com.


RE: How to delete a range of table ?

Posted by Jonathan Gray <jg...@facebook.com>.
Lots of reasons.  Given the way deletes currently work, it would be extremely expensive to process multi-row deletes.

At this point there are already people questioning if we should have row/family deletes because they are expensive to process.

If we move towards a new delete mechanism or optimization, see HBASE-2959 for some discussion on it, it may be feasible to have multi-row or row-range deletes but I would not expect this to be a high priority.

HBase is usually used when you have to keep lots of data, not when you have lots of data churn.  And typically when there is churn, it's done in a predictable way such that things like TTL can be used.

I'd be interested to hear all the use cases from those looking for range deletes.  Perhaps we could help you come up with some alternative strategies.  I agree scanning and issuing deletes is less than ideal.

JG

> -----Original Message-----
> From: Alexey Kovyrin [mailto:alexey@kovyrin.net]
> Sent: Friday, September 10, 2010 11:11 AM
> To: user@hbase.apache.org
> Subject: Re: How to delete a range of table ?
> 
> Is there any reason this operation is not a part of the api?
> 
> On Thu, Aug 19, 2010 at 10:47 PM, Stack <st...@duboce.net> wrote:
> > Not currently Jeff; on each next, do a delete.  Could save some by
> > making a deleting filter but that'd be a bit odd.
> > St.Ack
> >
> > On Thu, Aug 19, 2010 at 6:52 PM, Jeff Zhang <zj...@gmail.com> wrote:
> >> Hi all,
> >>
> >> I'd like to delete a range of table, but could not find a convenient
> >> api. One work around is first scan the range of table and then
> invoke
> >> delete operation for each row. This seems not so good, is there any
> >> other methods for this purpose ?
> >>
> >>
> >> --
> >> Best Regards
> >>
> >> Jeff Zhang
> >>
> >
> 
> 
> 
> --
> Alexey Kovyrin
> http://kovyrin.net/

Re: How to delete a range of table ?

Posted by Alexey Kovyrin <al...@kovyrin.net>.
Is there any reason this operation is not a part of the api?

On Thu, Aug 19, 2010 at 10:47 PM, Stack <st...@duboce.net> wrote:
> Not currently Jeff; on each next, do a delete.  Could save some by
> making a deleting filter but that'd be a bit odd.
> St.Ack
>
> On Thu, Aug 19, 2010 at 6:52 PM, Jeff Zhang <zj...@gmail.com> wrote:
>> Hi all,
>>
>> I'd like to delete a range of table, but could not find a convenient
>> api. One work around is first scan the range of table and then invoke
>> delete operation for each row. This seems not so good, is there any
>> other methods for this purpose ?
>>
>>
>> --
>> Best Regards
>>
>> Jeff Zhang
>>
>



-- 
Alexey Kovyrin
http://kovyrin.net/

Re: How to delete a range of table ?

Posted by Stack <st...@duboce.net>.
Not currently Jeff; on each next, do a delete.  Could save some by
making a deleting filter but that'd be a bit odd.
St.Ack

On Thu, Aug 19, 2010 at 6:52 PM, Jeff Zhang <zj...@gmail.com> wrote:
> Hi all,
>
> I'd like to delete a range of table, but could not find a convenient
> api. One work around is first scan the range of table and then invoke
> delete operation for each row. This seems not so good, is there any
> other methods for this purpose ?
>
>
> --
> Best Regards
>
> Jeff Zhang
>