Hive

Hive Tables

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

Share This Post

An Ambivert, music lover, enthusiast, artist, designer, coder, gamer, content writer. He is Professional Software Developer with hands-on experience in Spark, Kafka, Scala, Python, Hadoop, Hive, Sqoop, Pig, php, html,css. Know more about him at www.24tutorials.com/sai

Lost Password

Register

24 Tutorials