HIVE External Table

We will use External table when We want to retain the data even after dropping the table but where as it is not so in the case with HIVE Managed table,  We also use Hive, When the data need to be shared with other tools in the Hadoop Eco system such as Pig,Spark and so on and so forth.

Difference between Hive Managed Table vs External Table

      Hive MANAGED
                    Hive EXTERNAL Table
An ordinary table is called as Hive Managed table External table is created with the help of key word called EXTERNAL
The schema details will be stored in Hive Meta store and associated data will be stored into HDFS, While dropping the table we will loose the data in HDFS  Even if we drop the External table, we will not loose our data, since it is stored on our local file system as well as in HDFS

How to create Hive External Table?

It is very easy to create External Hive Table by only specifying External keyword.
Let us see how to create External Table in Hive.

Once after we create the table we need to load the data using LOAD DATA Hive query.

Let us try to drop this newly created External table to see what would the difference it makes with Hive managed table.

you could see in the user/hive/data warehouse/student folder with the data which was loaded by previous load statement. when you create the same table in the next time you can simply specify the location and that would still point to the data that has been loaded previously i.e before dropping the table.

 Casual Class Room Video

Here i am explaining about how to create Hive External Table and what is the differences it makes with Hive Managed Table.

Leave a comment

Your email address will not be published. Required fields are marked *