You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Ishaaq Chandy <is...@gmail.com> on 2009/07/08 07:34:04 UTC
delete all rows in table
Hi guys,
What is the quickest way to delete all the rows in a table without deleting
the table itself? The only way I can see would be to use a scanner. Is this
right? I am using 0.19.3.
Thanks,
Ishaaq
--
View this message in context: http://www.nabble.com/delete-all-rows-in-table-tp24385603p24385603.html
Sent from the HBase User mailing list archive at Nabble.com.
Re: delete all rows in table
Posted by stack <st...@duboce.net>.
View bin/HBase.rb. See what it does for a truncate. It calls HBaseAdmin
methods. Do same from your program.
St.Ack
On Tue, Jul 7, 2009 at 11:03 PM, Ishaaq Chandy <is...@gmail.com> wrote:
>
> Thanks, but I need to do this programmatically, not via the shell. The
> tables
> aren't huge - they only contain test data that needs to be cleaned up after
> the test cycle completes.
>
> Ishaaq
>
>
>
> stack-3 wrote:
> >
> > You could do that but would probably take some time. Or you could
> > truncate
> > the table via the shell. This does disable, drop, recreate in 0.19.x.
> In
> > TRUNK, it does disable, drop, major compaction of .META. table, and then
> > recreate (there is a known issue around dropping a big table. A
> > workaround
> > is to run major compaction on the .META. table. In 0.19.x, you can do
> > this
> > from the shell by doing 'major_compact ".META."'). Be warned that if
> your
> > table is big, users report our enable/disable is a flakey. You might
> have
> > to do it a few times to ensure all regions disabled before delete will
> > succeed (fix coming...).
> >
> > St.Ack
> >
> >
> > On Tue, Jul 7, 2009 at 10:34 PM, Ishaaq Chandy <is...@gmail.com> wrote:
> >
> >>
> >> Hi guys,
> >> What is the quickest way to delete all the rows in a table without
> >> deleting
> >> the table itself? The only way I can see would be to use a scanner. Is
> >> this
> >> right? I am using 0.19.3.
> >>
> >> Thanks,
> >> Ishaaq
> >> --
> >> View this message in context:
> >> http://www.nabble.com/delete-all-rows-in-table-tp24385603p24385603.html
> >> Sent from the HBase User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/delete-all-rows-in-table-tp24385603p24385875.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>
Re: delete all rows in table
Posted by Ishaaq Chandy <is...@gmail.com>.
Thanks, but I need to do this programmatically, not via the shell. The tables
aren't huge - they only contain test data that needs to be cleaned up after
the test cycle completes.
Ishaaq
stack-3 wrote:
>
> You could do that but would probably take some time. Or you could
> truncate
> the table via the shell. This does disable, drop, recreate in 0.19.x. In
> TRUNK, it does disable, drop, major compaction of .META. table, and then
> recreate (there is a known issue around dropping a big table. A
> workaround
> is to run major compaction on the .META. table. In 0.19.x, you can do
> this
> from the shell by doing 'major_compact ".META."'). Be warned that if your
> table is big, users report our enable/disable is a flakey. You might have
> to do it a few times to ensure all regions disabled before delete will
> succeed (fix coming...).
>
> St.Ack
>
>
> On Tue, Jul 7, 2009 at 10:34 PM, Ishaaq Chandy <is...@gmail.com> wrote:
>
>>
>> Hi guys,
>> What is the quickest way to delete all the rows in a table without
>> deleting
>> the table itself? The only way I can see would be to use a scanner. Is
>> this
>> right? I am using 0.19.3.
>>
>> Thanks,
>> Ishaaq
>> --
>> View this message in context:
>> http://www.nabble.com/delete-all-rows-in-table-tp24385603p24385603.html
>> Sent from the HBase User mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/delete-all-rows-in-table-tp24385603p24385875.html
Sent from the HBase User mailing list archive at Nabble.com.
Re: delete all rows in table
Posted by stack <st...@duboce.net>.
You could do that but would probably take some time. Or you could truncate
the table via the shell. This does disable, drop, recreate in 0.19.x. In
TRUNK, it does disable, drop, major compaction of .META. table, and then
recreate (there is a known issue around dropping a big table. A workaround
is to run major compaction on the .META. table. In 0.19.x, you can do this
from the shell by doing 'major_compact ".META."'). Be warned that if your
table is big, users report our enable/disable is a flakey. You might have
to do it a few times to ensure all regions disabled before delete will
succeed (fix coming...).
St.Ack
On Tue, Jul 7, 2009 at 10:34 PM, Ishaaq Chandy <is...@gmail.com> wrote:
>
> Hi guys,
> What is the quickest way to delete all the rows in a table without deleting
> the table itself? The only way I can see would be to use a scanner. Is this
> right? I am using 0.19.3.
>
> Thanks,
> Ishaaq
> --
> View this message in context:
> http://www.nabble.com/delete-all-rows-in-table-tp24385603p24385603.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>