EXPLAIN statement

Hive provides an EXPLAIN statement to return a query execution plan without running the query. We can use it to analyze queries if we have concerns about their performance. The EXPLAIN statement helps us to see the difference between two or more queries for the same purpose. The syntax for it is as follows:


The following keywords can be used:

  • FORMATTED: This provides a formatted JSON version of the query plan.
  • EXTENDED: This provides additional information for the operators in the plan, such as file pathname.
  • DEPENDENCY: This provides a JSON format output that contains a list of tables and partitions that the query depends on. It has been available since Hive ...

Get Apache Hive Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.