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

This tutorial describes how to disable and enable existing table using the HBase shell and will practice with some examples.

Disabling Table using HBase Shell

Use ‘disable‘ to disable a table. Prior to delete a table or change its setting, first, you need to disable the table.The syntax to disable the table is as follows.

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

Examples:

This disables the table ’emp’.

hbase disable table command

In the next section, let’s see how to check status of the table.

Checking Disabled Table

Use is_disabled to check if the table is disabled. When it disabled it returns ‘true

hbase disable table command

 Let’s check if the table disabled by using describe

hbase disable table command

Once the table is disabled, you can not perform regular manipulation commands. for example running a scan on the disable table results below error.

hbase disable table command

Enabling Table using HBase Shell

Use ‘enalbe‘ to enable a disabled table. You need to enable a disabled table first to perform any regular commands., The syntax to enable the table is as follows.

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

Examples:

This enables a table ’emp’ which was disabled in the previous section.

hbase enable table command

Now, let’s confirmed by running describe. try yourself by running a scan on this table to confirm.

hbase enable table command

Next, Let’s learn how to truncate and delete 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