You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by Marko Escriba <es...@gmail.com> on 2014/05/02 15:55:47 UTC

Remove Row Data

Hi,

Is it possible to remove number of rows from a table based from its Column
Qualifier or Family?
I have noticed that I can only remove on row, the latest inserted row (based
on timestamp). In case you want to ask why I need to remove rows, is for the
reason that I need to revert the failure transaction made by the webapp. Any
advice on this please.

Thanks.



--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573.html
Sent from the Developers mailing list archive at Nabble.com.

Re: Remove Row Data

Posted by Keith Turner <ke...@deenlo.com>.
The BatchDeleter pulls all data through the client, so it does not scale.
If this is a problem for you, then other options to be aware of are

 * Write a Filter or RowFilter and compact the table.  These filters will
run on the server side in parallel when you compact the table.
 * Write map reduce job that reads table and writes out deletes.

On Sun, May 4, 2014 at 7:51 PM, Marko Escriba <es...@gmail.com>wrote:

> Hi All,
>
> Yes! createBatchDeleter is the best option for me. Thank a lot for the
> guidance guys. :D.
>
>
>
> --
> View this message in context:
> http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573p9612.html
> Sent from the Developers mailing list archive at Nabble.com.
>

Re: Remove Row Data

Posted by Marko Escriba <es...@gmail.com>.
Hi All,

Yes! createBatchDeleter is the best option for me. Thank a lot for the
guidance guys. :D.



--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573p9612.html
Sent from the Developers mailing list archive at Nabble.com.

Re: Remove Row Data

Posted by Josh Elser <jo...@gmail.com>.
Invoke fetchColumn(Text, Text) or fetchColumnFamily(Text) with the 
appropriate columns and setRanges(Collection<Range>) with the Range(s) 
you want delete those columns from.

You can invoke the fetchColumn and fetchColumnFamily methods multiple 
times for multiple columns too.

On 5/2/14, 2:18 PM, Marko Escriba wrote:
> Yes you're right Christopher. Im sorry for the mistake. What I am really
> trying to do here is to remove rows that belongs to the same Column
> Family/Qualifier. I have not read the Mutation.putDelete and
> createBatchDeleter from the api docs. Thank you for the reference. I am just
> confused to where to put the criteria (columns/ranges) on createBatchDeleter
> config though.
>
>
>
> --
> View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573p9580.html
> Sent from the Developers mailing list archive at Nabble.com.
>

Re: Remove Row Data

Posted by Marko Escriba <es...@gmail.com>.
Yes you're right Christopher. Im sorry for the mistake. What I am really
trying to do here is to remove rows that belongs to the same Column
Family/Qualifier. I have not read the Mutation.putDelete and
createBatchDeleter from the api docs. Thank you for the reference. I am just
confused to where to put the criteria (columns/ranges) on createBatchDeleter
config though. 



--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573p9580.html
Sent from the Developers mailing list archive at Nabble.com.

Re: Remove Row Data

Posted by William Slacum <wi...@accumulo.net>.
I interpreted this as "I want to delete an entire row based on specific
column family and qualifier value."


On Fri, May 2, 2014 at 12:31 PM, Christopher <ct...@apache.org> wrote:

> I think there's a terminology mismatch in your question. It sounds
> like you're trying to remove single entries (Entry = Key/Value pair),
> not entire rows. Or, perhaps worded another way, you're trying to
> remove specific column families or columns from seom rows. Is that
> correct?
>
> To delete an entry, you need to use Mutation.putDelete() to insert a
> delete entry for a particular key you wish to remove. Typically you
> either know the key you wish to delete already, and can just insert
> the corresponding delete entry, or you have to scan to identify
> matching entries to delete, and issue deletes for each one that
> matches your delete criteria.
>
> The BatchDeleter helps you do the latter
> [Connector.createBatchDeleter()]. The BatchDeleter is like a scanner
> and a writer combined. You specify the scan criteria (which columns,
> ranges, iterators, etc.) to find the entries you wish to delete, and
> then you call its delete() method to scan and delete the matching
> entries. You can ensure your scan criteria is correct by issuing the
> same parameters to a BatchScanner that you would to the BatchDeleter,
> and ensuring the returned results are only those entries you wish to
> delete, before executing the BatchDeleter.
>
> If you only have a few entries to delete, you can delete them using
> the shell, with either the "delete" or "deletemany" command. The
> latter takes iterator and column options, just like a scanner. See the
> shell's internal help "help <command>" for more details.
>
>
>
> --
> Christopher L Tubbs II
> http://gravatar.com/ctubbsii
>
>
> On Fri, May 2, 2014 at 9:55 AM, Marko Escriba <es...@gmail.com>
> wrote:
> > Hi,
> >
> > Is it possible to remove number of rows from a table based from its
> Column
> > Qualifier or Family?
> > I have noticed that I can only remove on row, the latest inserted row
> (based
> > on timestamp). In case you want to ask why I need to remove rows, is for
> the
> > reason that I need to revert the failure transaction made by the webapp.
> Any
> > advice on this please.
> >
> > Thanks.
> >
> >
> >
> > --
> > View this message in context:
> http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573.html
> > Sent from the Developers mailing list archive at Nabble.com.
>

Re: Remove Row Data

Posted by Christopher <ct...@apache.org>.
I think there's a terminology mismatch in your question. It sounds
like you're trying to remove single entries (Entry = Key/Value pair),
not entire rows. Or, perhaps worded another way, you're trying to
remove specific column families or columns from seom rows. Is that
correct?

To delete an entry, you need to use Mutation.putDelete() to insert a
delete entry for a particular key you wish to remove. Typically you
either know the key you wish to delete already, and can just insert
the corresponding delete entry, or you have to scan to identify
matching entries to delete, and issue deletes for each one that
matches your delete criteria.

The BatchDeleter helps you do the latter
[Connector.createBatchDeleter()]. The BatchDeleter is like a scanner
and a writer combined. You specify the scan criteria (which columns,
ranges, iterators, etc.) to find the entries you wish to delete, and
then you call its delete() method to scan and delete the matching
entries. You can ensure your scan criteria is correct by issuing the
same parameters to a BatchScanner that you would to the BatchDeleter,
and ensuring the returned results are only those entries you wish to
delete, before executing the BatchDeleter.

If you only have a few entries to delete, you can delete them using
the shell, with either the "delete" or "deletemany" command. The
latter takes iterator and column options, just like a scanner. See the
shell's internal help "help <command>" for more details.



--
Christopher L Tubbs II
http://gravatar.com/ctubbsii


On Fri, May 2, 2014 at 9:55 AM, Marko Escriba <es...@gmail.com> wrote:
> Hi,
>
> Is it possible to remove number of rows from a table based from its Column
> Qualifier or Family?
> I have noticed that I can only remove on row, the latest inserted row (based
> on timestamp). In case you want to ask why I need to remove rows, is for the
> reason that I need to revert the failure transaction made by the webapp. Any
> advice on this please.
>
> Thanks.
>
>
>
> --
> View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Remove-Row-Data-tp9573.html
> Sent from the Developers mailing list archive at Nabble.com.