Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - Command to delete based on column Family + rowkey


Copy link to this message
-
Re: Command to delete based on column Family + rowkey
Jean-Daniel Cryans 2013-09-16, 19:06
HBASE-8753 doesn't seem related.

Right now there's nothing in the shell that does the equivalent of this:

Delete.deleteFamily(byte [] family)

But it's possible to run java code in the jruby shell so in the end you can
still do it, just takes more lines.

J-D
On Mon, Sep 16, 2013 at 1:45 AM, Ted Yu <[EMAIL PROTECTED]> wrote:

> Have you looked at https://issues.apache.org/jira/browse/HBASE-8753 ?
>
> Cheers
>
> On Sep 16, 2013, at 12:37 AM, Ramasubramanian <
> [EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > Thanks…but the requirement is to delete the fields for a single row key…
> can u pls help?
> >
> > regards,
> > Rams
> > On 10-Sep-2013, at 4:56 PM, Jean-Marc Spaggiari <[EMAIL PROTECTED]>
> wrote:
> >
> >> This?
> >>
> >> hbase(main):002:0> help "alter"
> >> Alter column family schema;  pass table name and a dictionary
> >> specifying new column family schema. Dictionaries are described
> >> on the main help command output. Dictionary must include name
> >> of column family to alter. For example,
> >>
> >> To change or add the 'f1' column family in table 't1' from defaults
> >> to instead keep a maximum of 5 cell VERSIONS, do:
> >>
> >> hbase> alter 't1', NAME => 'f1', VERSIONS => 5
> >>
> >> To delete the 'f1' column family in table 't1', do:
> >>
> >> hbase> alter 't1', NAME => 'f1', METHOD => 'delete'
> >>
> >> or a shorter version:
> >>
> >> hbase> alter 't1', 'delete' => 'f1'
> >>
> >>
> >>
> >> 2013/9/10 Ramasubramanian Narayanan <
> [EMAIL PROTECTED]>
> >>
> >>> Manish,
> >>>
> >>> I need to delete all the columns for a particular column family of a
> given
> >>> rowkey... I don't want to specify the column name (qualifier name) one
> by
> >>> one to delete.....
> >>>
> >>> Pls let me know is there any way to delete like that...
> >>>
> >>> regards,
> >>> Rams
> >>>
> >>>
> >>> On Tue, Sep 10, 2013 at 2:06 PM, manish dunani <[EMAIL PROTECTED]>
> >>> wrote:
> >>>
> >>>> If you want to delete rowkey for particular columnfamily then you
> need to
> >>>> mention individually::>>>
> >>>>
> >>>>> delete 'ttttt','333','TWO:qualifier_name'
> >>>>
> >>>> This will definitely delete the records which you are looking for.
> >>>> Please revert back if it is not work.
> >>>>
> >>>>
> >>>> On Tue, Sep 10, 2013 at 1:40 PM, manish dunani <[EMAIL PROTECTED]>
> >>>> wrote:
> >>>>
> >>>>> hey rama,
> >>>>>
> >>>>> Try this::
> >>>>>
> >>>>>> *deleteall 'ttttt','333'*
> >>>>> *
> >>>>> *
> >>>>> I hope it will definitely works for you!!
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Tue, Sep 10, 2013 at 1:31 PM, Ramasubramanian Narayanan <
> >>>>> [EMAIL PROTECTED]> wrote:
> >>>>>
> >>>>>> Dear All,
> >>>>>>
> >>>>>> Requirement is to delete all columns which belongs to a column
> family
> >>>> and
> >>>>>> for a particular rowkey.
> >>>>>>
> >>>>>> Have tried with the below command but record is not getting deleted.
> >>>>>>
> >>>>>> *  hbase> deleteall 't1', 'r1', 'c1'*
> >>>>>> *
> >>>>>> *
> >>>>>> *Test result :*
> >>>>>> *
> >>>>>> *
> >>>>>> 3) Scan the table 'ttttt'
> >>>>>>
> >>>>>> hbase(main):025:0> scan 'ttttt'
> >>>>>> ROW                                           COLUMN+CELL
> >>>>>> 111                                          column=ONE:ename,
> >>>>>> timestamp=1378459582478, value=aaaa
> >>>>>> 111                                          column=ONE:eno,
> >>>>>> timestamp=1378459582335, value=1000
> >>>>>> 111                                          column=ONE:sal,
> >>>>>> timestamp=1378459582515, value=1500
> >>>>>> 111                                          column=TWO:ename,
> >>>>>> timestamp=1378459582655, value=dddd
> >>>>>> 111                                          column=TWO:eno,
> >>>>>> timestamp=1378459582631, value=4000
> >>>>>> 222                                          column=ONE:ename,
> >>>>>> timestamp=1378459582702, value=bbbb
> >>>>>> 222                                          column=ONE:eno,
> >>>>>> timestamp=1378459582683, value=2000