HiveServer2 Beeline Introduction 3


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

Sessions/Currency

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

Authentication/Authorization

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

HiveServer2

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.

hiveserver2

Sourced from cloudera.com

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.