Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to kill a scan operation in hbase shell without Ctrl-C

Sometimes when I run a scan '<tablename>. I see a continuous flood of data being printed because the table is big. I want to kill the process that print the data. Is there a way to do it other than Ctrl-C? because Ctrl-C kills the shell process and I don't want to exit the shell.

like image 208
ssgao Avatar asked Jun 11 '13 14:06

ssgao


People also ask

What is scan in HBase?

Scaning using HBase Shell The scan command is used to view the data in HTable. Using the scan command, you can get the table data. Its syntax is as follows: scan '<table name>'

What is the difference between scan and get in HBase?

When you compare a partial key scan and a get, remember that the row key you use for Get can be a much longer string than the partial key you use for the scan. In that case, for the Get, HBase has to do a deterministic lookup to ascertain the exact location of the row key that it needs to match and fetch it.

What are the data manipulation commands of HBase?

Moreover, These HBase commands are create, update, read, delete, scan, count and truncate data manipulation.


1 Answers

You could use scan with LIMIT to limit the scan output on shell :

scan 'table', LIMIT => 5

This will show you only 5 rows. You could also press ctlr+s to hold the scan, if you have done a full scan and want to hold on at a specific row.

like image 158
Tariq Avatar answered Nov 09 '22 06:11

Tariq