Hive supports 2 types of tables :
1. Managed / Internal tables
2. External Tables
Managed Tables
– Life cycle of data in the table is controlled by Hive
– data is stored under the sub directory defined by ‘
hive.metastore.warehouse.dir ‘
– When table is dropped , data & metadata is deleted
– Not a good choice for sharing data with other tools
External Tables
– Use the keyword EXTERNAL with CREATE TABLE
– Life cycle of data in the table is NOT controlled by Hive
– data is stored under the directory defined by LOCATION clause in the CREATE
TABLE command
– When table is dropped , data is not deleted but metadata is deleted
– Better choice for sharing data with other tools
– Few HiveQL constructs are not allowed for external tables
DESCRIBE EXTENDED <<table name>> could be used to check if a
table is managed or external