• Post author:
  • Post category:HBase
  • Post last modified:March 27, 2024
  • Reading time:4 mins read

This tutorial describes how to check/verify if the table exists and get the counts in a table using the HBase shell and will practice with some examples.

Verifying table exists using HBase Shell

Use exists command to verify if the table present in the database. Let’s see the syntax, usage with some examples.

Syntax: exists ‘<namespace>:<table_name>’

Example:

exists returns boolean along with the message. returns ‘true‘ when the table present in the database.

Returns ‘false‘ when table not present in the database.

Count Usage

Use count command to get the total records in a table. Let’s see the syntax, usage with some examples.

Syntax: count ‘<namespace>,<table_name>’

Returns the number of rows in a table.

When table is not found it returns an error ‘Unknown table’

Next, Let’s learn how to Disable and Enable a table.

Naveen Nelamali

Naveen Nelamali (NNK) is a Data Engineer with 20+ years of experience in transforming data into actionable insights. Over the years, He has honed his expertise in designing, implementing, and maintaining data pipelines with frameworks like Apache Spark, PySpark, Pandas, R, Hive and Machine Learning. Naveen journey in the field of data engineering has been a continuous learning, innovation, and a strong commitment to data integrity. In this blog, he shares his experiences with the data as he come across. Follow Naveen @ LinkedIn and Medium