Search code examples
hadoophivehdfscreate-tablehive-metastore

Where does Hive store its data?


I am a little confused on where Hive stores its data.

Does it store its data in HDFS or in a RDBMS? Does Hive Metastore use a RDBMS to store the Hive tables metadata?


Solution

  • Hive data are stored in one of Hadoop compatible filesystem: S3, HDFS or other compatible filesystem.

    Hive metadata are stored in RDBMS like MySQL, see supported RDBMS.

    The location of Hive tables data in S3 or HDFS can be specified for both managed and external tables.

    The difference between managed and external tables is that DROP TABLE statement, in managed table, will drop the table and delete table's data. Whereas, for external table DROP TABLE will drop only the table and data will remain as is and can be used for creating other tables over it.

    See details here: Create/Drop/Truncate Table