158 | Big Data Simplied
As illustrated in Figure 7.2, the typical overview of a Hive query owing through a system is
explained as follows.
1. Initially, user issues the query through a User Interface (UI) which calls the execute interface
to the Hive Driver.
2. The driver then creates a session handle for the query and takes the help of query compiler
that parses the query to check the syntax and requirement of the query.
3. GET Metadata: The compiler needs the metadata about the table. So it sends a request for
getMetaData() to the Metastore.
4. SEND Metadata: Hive compiler receives the metadata from Hive Metastore.
5. Then the compiler uses this metadata to type check the expressions in the query. The com-
piler generates the plan which is DAG (Directed Acyclic Graph) of stages with each stage
either being a map/reduce job, a metadata operation or an operation on HDFS. Compiler
resends the plan to the Driver. At this stage, the parsing and compiling of a query is complete.
6. Driver sends the execute plan to the Hive Execution Engine. The execution engine then sub-
mits these stages to appropriate components.
Meanwhile in execution, the execution engine can operate the metadata operation with
Hive Metastore.
7. Internally, the process of job execution is a MapReduce job through YARN container.
The processing can be placed in another Hive execution engine called TEZ with a session
level parameter set.
8. Fetch Query Result: The execution engine receives the result from the computation engine
(MR/TEZ).
9. Send result: The execution engine sends the resultant values to the Driver.
10. Send result to the user: Finally, the Driver sends the results to the Hive interface.
7.2.3 Data Types in Hive
Hive supports different data types to be used in table columns. The data types supported by Hive
can be categorized into primitive and complex data types.
Primitive Data Type
1. Numeric Types
TINYINT (1-byte signed integer, from −128 to 127)
SMALLINT (2-byte signed integer, from −32,768 to 32,767)
INT (4-byte signed integer, from −2,147,483,648 to 2,147,483,647)
BIGINT (8-byte signed integer, from −9,223,372,036,854,775,808 to 9,223,372,036,854,
775,807)
FLOAT (4-byte single precision floating point number)
DOUBLE (8-byte double precision floating point number)
DECIMAL (Hive 0.13.0 introduced user definable precision and scale)
M07 Big Data Simplified XXXX 01.indd 158 5/17/2019 2:50:01 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset