Hive
What is Hive?
Hive is a data warehouse tool to analyze structured data in Hadoop. It was developed by Facebook. It resides on top of Hadoop and used to abstract Data, and makes querying and analyzing easy. It is a platform used to develop SQL type scripts to do MapReduce operations.
Note - It helps in reading and writing data in Hadoop and process it without writing complex java programs.
Note - It helps in reading and writing data in Hadoop and process it without writing complex java programs.
.
Features:
- It is OLAP (Online Analytical Processing).
- It is fast, scalable and familiar.
- It is similar to SQL language for querying called HQL (Hive Query Language).
- It supports Data Manipulation Language and Data definition Language.
- It works on server-side of HDFS cluster.
There are two types of tables in hive:
Internal Table and External table
Note: Default location is /user/hive/warehouse.
Internal Table (Managed table): In Internal Table, Both the table schema and table data are managed by hive. The data will be located in a folder named after the table within the hive data warehouse, which is essentially just a file location in HDFS.
If you drop(delete) managed table, then hive will delete both table schema and table data.
External Table: In External Table, only table schema is managed by hive. User can setup the folder location in HDFS and copy the data files there.
When external table is deleted, Only the schema will be deleted associated with the table. Data files will not be affected.
Partitioning:
Hive organizes tables into partitions for grouping same type of data together based on a column or partition key. Each table in the hive can have one or more partition keys to identify a particular partition. Using partition we can make it faster to do queries on slices of the data.
Bucketing:
In Hive Tables, partitions are subdivided into buckets based on the hash function of a column in the table to give extra structure to the data that may be used for more efficient queries.
Comments
Post a Comment
If you have any doubts, Please let me know