Hive Tables

Posted at  23:27  |  in  HIVE

As of now we have seen Hive Introduction. We know that HIVE is used to pose queries on the processed data. Generally in RDBMS we pose queries on Tables. Hive also stores the data in the form of Tables, these tables are stored on HDFS. The following are the two types of tables in HIVE.
  • Managed Tables
  • External Tables
Hive also stores the metadata of these tables in Hive Metastore. In this post let us see in detail about how to create a table, and how to import data into them.

Managed Tables: 

As the name implies, these tables are managed by Hive Warehouse system. All the Managed tables will be stored in the sub-directories of Hive Warehouse directory. The following is the command tothe Managed Tables.
Managed Table Example
Managed Table Creation

The following is the example of Managed tables:
Managed Table example
Managed table example

External Tables:

As the name implies these are not managed by Warehouse. All the external tabular data is stored in the location specified in the at the time of creation. The following is the syntax to create the External tables. 
External Table Syntax
External Table Syntax
If we don't specify the HDFS location or external keyword in the command, it will create a Managed table instead of External table. The following is the example of external table. 
External Table example
External Table Example
  
       


 

Share this post

About-Privacy Policy-Contact us
Copyright © 2013 Hadoop Tutor. Blogger Template by Bloggertheme9
Proudly Powered by Blogger.
back to top