The Hive interface such as Command Line or Web UI sends query to Driver (any database driver such as JDBC, ODBC, etc.) to execute
The driver takes the help of query compiler that parses the query to check the syntax and query plan or the requirement of query.
The compiler sends metadata request to Metastore (any database).
Metastore sends metadata as a response to the compiler
The compiler checks the requirement and resends the plan to the driver. Up to here, the parsing and compiling of a query is complete.
The driver sends the execute plan to the execution engine
Internally, the process of execution job is a MapReduce job. The execution engine sends the job to JobTracker, which is in Name node and it assigns this job to TaskTracker, which is in Data node. Here, the query executes MapReduce job.
Meanwhile in execution, the execution engine can execute metadata operations with Metastore
The execution engine receives the results from Data nodes
The execution engine sends those resultant values to the driver.
The driver sends the results to Hive Interfaces