Data Deletion in HBase Table
12K views
Oct 24, 2024
Data Deletion in HBase Table
View Video Transcript
0:00
In this video we are going to discuss data deletion in edge base table
0:05
How to delete enter row, how to delete a certain cell, we'll be discussing them
0:11
So how to delete data from a table in edge base? Using the delete command you can delete a specific cell in a table
0:20
So syntax will be delete table name, comma, row name, comma column family, column name
0:28
So here we are mentioning the column family. column the column name and co comma the timestamp so the timestamp field is optional
0:36
you can delete data without using timestamp also so this is a syntax to
0:41
delete a certain cell that is a certain column under one column family so to delete
0:47
the enter row the syntax will be like this there is a delete all table name
0:52
comma row num in that case the enter row will get deleted for the better understanding
0:58
let us go for one practical demonstration where we'll be showing that how this delete command
1:03
or delete all command will be working there. In this demonstration we shall discuss how we can delete data from the table
1:12
So before going for the deletion at first we should see what is the current content of our table So we are issuing the command scan student So I shall write this one as scan student
1:26
So you see this is the current content. So now I shall go for the deletion
1:31
So how to do the deletion? So let us suppose delete the data of city cell from the row number two
1:40
So row number two, we can have that for this row number two. we're having this city the value for this row number two we're having the city value is
1:48
Kolkata okay so I want I want to delete that one so how to write this one so I
1:53
shall go for this delete and then student obviously within single quotes then
1:59
student then comma then two must be also in single quotes then comma then personal
2:06
data and what is the data city so this is a respective so I should
2:13
be sticking with the single course only and then we shall press enter so delete
2:19
student that is a table name comma 2 that is a row number 2 there is a second
2:23
record we are having this one as personal underscore data colon city so now the
2:30
respective record has got deleted so let us go for a cross check we shall go for this one as scan student you can find that the Kolkata is missing so for the for the second row we are having only three rows are there so the city is missing here so it has got deleted so after doing the
2:48
scan student I've got the idea that that row has got deleted now so now if I
2:54
want to delete the enter row whose row number is to I want to delete the
2:59
enter row whose row number is two so how to do that one so
3:03
in that case we shall go for say delete all student within single code comma 2 only and 2
3:13
should be also in single code so here you see i'm not mentioning after this two i'm not going
3:18
to mention that is a personal underscore data colon city within the single code i'm not mentioning
3:25
that one so as i'm not mentioning anything so it will delete the enter row number 2
3:30
as a whole so let us go for enter and you can go for the scan student you can go
3:38
for the scan student you can find that we're having this row number one but
3:45
having this row number two so we're having a column families like your college
3:52
data and personal data so accordingly they are surviving but only all the details against the road number 2 it has got deleted and that that is the purpose here so how to
4:03
drop the table now you see how to drop the table so we shall go for this one as a drop
4:09
student so if you go for the drop student you see the table student is
4:17
enabled disable at first then go for the dropping so disable student
4:24
disabled student so is disabled student
4:38
so is disabled that means I should have to check whether the table has got disabled or not
4:45
so I think it should be disabled so let me go for the cross check yes it is not
4:51
now so it is true so then if I go for the drop student now you think you see
5:00
the table has been dropped so now if I go for the scan student I cannot access
5:05
the content I cannot access the content so in this way I've shown you that
5:10
how to perform the deletion from the age-based tables thanks for watching this demonstration
#Data Management
#Other
#Programming