Help Center/ MapReduce Service/ User Guide (ME-Abu Dhabi Region)/ Troubleshooting/ Using Hive/ How Do I Release Disk Space After Dropping a Table in Hive?
Updated on 2022-12-08 GMT+08:00

How Do I Release Disk Space After Dropping a Table in Hive?

Issue

After a user runs the drop command on the Hive CLI to drop a table and then uses the hdfs dfsadmin -report command to check the disk space, the command output shows that the table is not deleted.

Cause Analysis

The drop command executed on the Hive CLI deletes only the table structure of the external table, but not the table data stored in HDFS.

Procedure

  1. Log in to the node where the client is installed as user root and authenticate the component user.

    cd Client installation directory

    source bigdata_env

    kinit Component service user (Skip this step for clusters with Kerberos authentication disabled.)

  2. Run the following command to delete the table stored in HDFS:

    hadoop fs -rm hdfs://hacluster/Path of the table