hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Re: Command to delete based on column Family + rowkey
Date Tue, 10 Sep 2013 11:26:11 GMT
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 <ramasubramanian.narayanan@gmail.com>

> 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 <manishd207@gmail.com>
> 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 <manishd207@gmail.com>
> > 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 <
> > > ramasubramanian.narayanan@gmail.com> 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
> > >>  222                                          column=ONE:sal,
> > >> timestamp=1378459582723, value=2500
> > >>  222                                          column=TWO:ename,
> > >> timestamp=1378459582779, value=gggg
> > >>  222                                          column=TWO:eno,
> > >> timestamp=1378459582754, value=4000
> > >>  222                                          column=TWO:sal,
> > >> timestamp=1378459582798, value=7500
> > >>  333                                          column=ONE:ename,
> > >> timestamp=1378459582880, value=sss
> > >>  333                                          column=ONE:eno,
> > >> timestamp=1378459582845, value=9000
> > >>  333                                          column=ONE:sal,
> > >> timestamp=1378459582907, value=6500
> > >>  333                                          column=TWO:ename,
> > >> timestamp=1378459582950, value=zzz
> > >>  333                                          column=TWO:eno,
> > >> timestamp=1378459582931, value=6666
> > >>  333                                          column=TWO:sal,
> > >> timestamp=1378459582968, value=6500
> > >> 3 row(s) in 0.0440 seconds
> > >>
> > >>
> > >>
> >
> -------------------------------------------------------------------------------------------------------------------------------------
> > >> 4) Delete the records from the table 'ttttt' in the rowkey '333' in
> the
> > >> column family 'TWO'
> > >>
> > >>
> > >> hbase(main):027:0> deleteall 'ttttt','333','TWO'
> > >> 0 row(s) in 0.0060 seconds
> > >>
> > >>
> > >>
> >
> -------------------------------------------------------------------------------------------------------------------------------------
> > >>
> > >> 5) After deleting scan the table
> > >>
> > >> hbase(main):028: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
> > >>  222                                          column=ONE:sal,
> > >> timestamp=1378459582723, value=2500
> > >>  222                                          column=TWO:ename,
> > >> timestamp=1378459582779, value=gggg
> > >>  222                                          column=TWO:eno,
> > >> timestamp=1378459582754, value=4000
> > >>  222                                          column=TWO:sal,
> > >> timestamp=1378459582798, value=7500
> > >>  333                                          column=ONE:ename,
> > >> timestamp=1378459582880, value=sss
> > >>  333                                          column=ONE:eno,
> > >> timestamp=1378459582845, value=9000
> > >>  333                                          column=ONE:sal,
> > >> timestamp=1378459582907, value=6500
> > >>  333                                          column=TWO:ename,
> > >> timestamp=1378459582950, value=zzz
> > >>  333                                          column=TWO:eno,
> > >> timestamp=1378459582931, value=6666
> > >>  333                                          column=TWO:sal,
> > >> timestamp=1378459582968, value=6500
> > >> 3 row(s) in 0.0310 seconds
> > >>
> > >> Observation :-
> > >> ------------------
> > >>    No records got deleted
> > >>
> > >> regards,
> > >> Rams
> > >>
> > >
> > >
> > >
> > > --
> > > Regards
> > >
> > > *Manish Dunani*
> > > *Contact No* : +91 9408329137
> > > *skype id* : manish.dunani*
> > > *
> > >
> > >
> > >
> >
> >
> > --
> > Regards
> >
> > *Manish Dunani*
> > *Contact No* : +91 9408329137
> > *skype id* : manish.dunani*
> > *
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message