Hive defines a simple SQL-like query language, called QL, that enables users familiar with SQL to query the data. At the same time, this language also allows programmers who are familiar with the MapReduce framework to be able to plug in their custom mappers and reducers to perform more sophisticated analysis that may not be supported by the built-in capabilities of the language. QL can also be extended with custom scalar functions (UDF's), aggregations (UDAF's), and table functions (UDTF's).
Hive Query Language provides following features
- From clause subquery
- ANSI JOIN (euqi-joini only)
- Multi-table Insert
- Multi group-by
- Objects traversal
- Pluggable MapReduce scripts in the language of your choice using TRANSFORM (Syntax changing soon!!)
- Pluggable User Defined Functions
- Pluggable User Defined Types
- Pluggable SerDes to read different konds of Data Formats
SELECT pageid, COUNT(DISTINCT userid)
FROM page_view GROUP BY pageid
Hive does not mandate read or written data be in the "Hive format"---there is no such thing. Hive works equally well on Thrift, control delimited, or your specialized data formats. Please see File Format and SerDe in the Developer Guide for details.
Hive is not designed for OLTP workloads and does not offer real-time queries or row-level updates. It is best used for batch jobs over large sets of append-only data (like web logs). What Hive values most are scalability (scale out with more machines added dynamically to the Hadoop cluster), extensibility (with MapReduce framework and UDF/UDAF/UDTF), fault-tolerance, and loose-coupling with its input formats.
Following is Data Model for Hive.
Hive ApacheCon 2008, New Oreleans, LA (Ashish Thusoo, Facebook)