HBase Tutorial
HBase Resources
Selected Reading
- HBase - Security
- HBase - Count & Truncate
- HBase - Scan
- HBase - Delete Data
- HBase - Read Data
- HBase - Update Data
- HBase - Create Data
- HBase - Client API
- HBase - Shutting Down
- HBase - Drop a Table
- HBase - Exists
- HBase - Describe & Alter
- HBase - Enabling a Table
- HBase - Disabling a Table
- HBase - Listing Table
- HBase - Create Table
- HBase - Admin API
- HBase - General Commands
- HBase - Shell
- HBase - Installation
- HBase - Architecture
- HBase - Overview
- HBase - Home
HBase Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
HBase - Count & Truncate
HBase - Count & Truncate
count
You can count the number of rows of a table using the count command. Its syntax is as follows:
count ‘<table name>’
After deleting the first row, emp table will have two rows. Verify it as shown below.
hbase(main):023:0> count emp 2 row(s) in 0.090 seconds ⇒ 2
truncate
This command disables drops and recreates a table. The syntax of truncate is as follows:
hbase> truncate table name
Example
Given below is the example of truncate command. Here we have truncated the emp table.
hbase(main):011:0> truncate emp Truncating one table (it may take a while): - Disabpng table... - Truncating table... 0 row(s) in 1.5950 seconds
After truncating the table, use the scan command to verify. You will get a table with zero rows.
hbase(main):017:0> scan ‘emp’ ROW COLUMN + CELL 0 row(s) in 0.3110 secondsAdvertisements