HIVE DB directory is hidden


#1

Hi,

If I create a DB at a specific HDFS location (using below command), I am not able to see the directory ‘petriol_db5’ at ‘/user/sreemeetsu/HIVE/hivedb1’. The directory is not created at default location ‘/apps/hive/warehouse/’ as well.

CREATE DATABASE petriol_db5
LOCATION ‘/user/sreemeetsu/HIVE/hivedb1’;

The DB petriol_db5 is accessible from Hive, but not seeing the directory in HDFS location.

If I do a describe of the DB, it shows that the DB is created at the hdfs location I provided.

hive (petriol_db5)> describe database extended petriol_db5;
OK
petriol_db5 hdfs://nn01.itversity.com:8020/user/sreemeetsu/HIVE/hivedb1 sreemeetsu USER
Time taken: 0.034 seconds, Fetched: 1 row(s)

But when I browse to the location, I don’t see a directory

[sreemeetsu@gw01 ~]$ hadoop fs -ls /user/sreemeetsu/HIVE/hivedb1/
Found 4 items
drwxr-xr-x - sreemeetsu hdfs 0 2017-10-29 20:43 /user/sreemeetsu/HIVE/hivedb1/petrol_table
drwxr-xr-x - sreemeetsu hdfs 0 2017-10-29 13:07 /user/sreemeetsu/HIVE/hivedb1/petrol_with_null
drwxr-xr-x - sreemeetsu hdfs 0 2017-10-18 13:54 /user/sreemeetsu/HIVE/hivedb1/transaction_sample
drwxr-xr-x - sreemeetsu hdfs 0 2017-10-18 13:42 /user/sreemeetsu/HIVE/hivedb1/transactions


#2

@sreejith_padappayil Please refer below screenshots. The database is creating under specified location but we are able to view after creating table under that database.