HiveServer2 Beeline Introduction 4

In this post we will discuss about HiveServer2 Beeline Introduction. As of hive-0.11.0, Apache Hive started decoupling HiveServer2 from Hive. It is because of overcoming the existing Hive Thrift Server.

Below are the Limitations of Hive Thrift Server 1

  • No Sessions/Concurrency
  • Essentially need 1 server per client
  • Security
  • Client Interface
  • Stability


  • Old Thrift API and server implementation didn’t support concurrency.


  • Incomplete implementations of Authentication (verifying the identity of the user) and Authorizations (Verifying if user has permissions to perform this action).


HiveServer2 is a container for the Hive execution engine (Driver). For each client connection, it creates a new execution context (Connection and Session) that serves Hive SQL requests from the client. The new RPC interface enables the server to associate this Hive execution context with the thread serving the client’s request.

Below is the high level architecture of HiveServer2.


Sourced from

Run HiveServer2:

We can start Thrift HiveServer2 service with the below command if hive-0.11.0 or above is installed in our machine.

If we need to customize HiveServer2, we can set below properties in hive-site.xml file.

Start Beeline Client for HiveServer2:

We can start the client service for HiveServer2 from various clients like SQLine, Beeline or Squirrel or Web Interface. But in this we will see how to connect to HiveServer2 via Beeline client.

Below command can be used to connect to HiveServer2.