See:
https://cwiki.apache.org/confluence/display/Hive/Managed+vs.+External+Tables
-
Internal (managed) Table: Hive manage both the metadata and the data of the table.
If a managed table is dropped then the table data and its metadata are deleted.
The data of a managed table (for a specific database DATABASE-NAME.db
) is stored under the hive.metastore.warehouse.dir
directory (default: /hive/warehouse/
).
-
External Table: Hive manage only the metadata of the table while the data is located into a location specified when the table is created.
If an external table is dropped then only the table metadata is deleted.
You can use the command
DESCRIBE FORMATTED table_name
to identify if a table is an internal (managed) or an external table.
The command displays
MANAGED_TABLE
for internal table type and
EXTERNAL_TABLE
for external table type.
Describe internal tables:
Describe external tables: