Search code examples
hivehdfshive-metastore

What is hive.metastore.warehouse.dir for?


I am new to HIVE, I am trying to setup a hive metastore service with standalone MySQL DB, and I realized that I need to config hive.metastore.warehouse.dir in the hive-site.xml, but I am having a hard time to understand what it is for?

1, None of the metadata will be stored in this location, because all of the metadata will be stored in the MySQL db.

2, None of the data files will be stored in this location, because I am not setting up a Hive data service, it is just a metastore service. And when creating hive tables, I will specify the location of the table.

Why do I still need to set this configuration?


Solution

  • spark.sql.warehouse.dir is a static configuration property that sets Hive’s hive.metastore.warehouse.dir property, i.e. the location of default database for the Hive warehouse

    1. That is correct. This directory indicates where the actual data in the tables will reside.

    2. It sounds like in most of your situations, the data will reside outside of what you set for this directory. However, if a user were to forget to set the location or if there are any internal/automated calls that use the "default" database. This is where your "default" data will reside.