Apache Hive Architecture and Apache Hive Mode
Apache Hive Architecture and Apache Hive Mode are the important topic, lets discuss that.
Major components of the Apache Hive architecture are:
- CLI, UI, and Thrift Server
- Stores metadata of the tables such as their schema and location.
- It also includes the partition metadata which helps the driver to track the progress of various data sets over the cluster.
- The metadata keeps track of the data, replicates the data and provides a backup in case of data loss.
- Acts like a controller which receives the HiveQL statements.
- It executes the statement by creating sessions and monitors the life cycle.
- Stores the necessary metadata generated during the execution of an HiveQL statement.
- The driver also acts as a collection point of data i.e query result obtained after the Reduce operation
- Performs compilation of the HiveQL query, which converts the query to an execution plan
- Compiler performs MapReduce on Execution plan(contains the tasks and steps) to get an output.
- The compiler converts the query to an abstract syntax tree (AST). After checking for compatibility and compile time errors, it again converts the AST to a directed acyclic graph (DAG).
- It apply transformations on the execution plan to get an optimized DAG.
- optimizer apply transformations to converting a pipeline of joins to a single join, for better performance.
- It can also split the tasks i.e apply transformation on data before a reduce operation, to get better performance and scalability.
- executor executes the tasks
- It interacts with the job tracker in Hadoop to schedule tasks to run.
- It takes care of pipelining the tasks.
- CLI, UI, and Thrift Server
- A command-line interface (CLI) provides a user interface for an external user to interact with Hive by submitting queries.
- Thrift server allows external clients to interact with Hive over a network.
- User interface (UI) provide the execute interface to the driver.
Apache Hive Mode
Apache Hive mode can be operated based on the size of data nodes in Hadoop.
- Local mode
- Map reduce mode
- Local mode is used when ,Hadoop is installed under pseudo mode with single data node.
- Single local machine with small data size uses local mode.
- In local machine processing speed is very fast due to smaller data sets.
- In order to work with hive local mode we need to set
Map reduce mode
- Map reduce mode is used when ,Hadoop is installed under multiple data nodes and data is distributed across different node.
- It is used when large amount of data sets and query need to execute in parallel way.
- This mode is used to achive better performance over large data sets.
Note: By default Apache hive can works on Map Reduce mode and for local mode we need to follow the above setting.
References for Apache Hive Architecture and Apache Hive Mode
That’s all about the Apache Hive Architecture and Apache Hive Mode, lets move on further topics.