Section 10:106. Hive Query- Execution Life cycle

The Hive Query Execution Life Cycle involves multiple steps that are as follows:

  1. Parsing: The first step of the query execution life cycle is parsing. In this step, Hive parses the SQL query to check its syntax and verify that it is valid. If the query is not valid, then Hive will return an error message.
  1. Compilation: After parsing, the next step is compilation. In this step, Hive compiles the parsed query into a logical plan. The logical plan represents the sequence of operations that Hive will perform to execute the query.
  1. Optimization: Once the logical plan is created, Hive performs query optimization. In this step, Hive applies various optimization techniques to the logical plan to make it more efficient. Hive can perform optimizations like predicate pushdown, join optimization, and column pruning to reduce the amount of data read and processed.
  1. Physical Plan Generation: After optimization, Hive generates a physical plan from the optimized logical plan. The physical plan represents the actual sequence of MapReduce jobs that Hive will execute to perform the query.
  1. Execution: In this step, Hive executes the physical plan. Hive submits the MapReduce jobs to the Hadoop cluster, which then executes them in parallel.
  1. Fetching Results: After the execution is complete, Hive retrieves the results from the Hadoop cluster and returns them to the user.
  1. Cleanup: Finally, Hive performs cleanup tasks like closing open resources, deleting temporary files, and releasing memory.

Overall, the Hive Query Execution Life Cycle involves parsing, compilation, optimization, physical plan generation, execution, fetching results, and cleanup. By performing these steps in sequence, Hive can efficiently execute SQL queries on large-scale datasets stored in Hadoop.

Share this post