Skip to content

Connecting to an Existing Hive Metastore

It is possible to configure Okera to connect to an existing Hive metastore (HMS). This allows Okera to automatically see all existing metadata in your catalog without having to register it again.

The following HMS versions are supported:

  • HMS 1.x
  • HMS 2.3

If you have a different HMS version, contact Okera support.

Note: Currently, Okera requires that the database server that HMS is on is also where all other Okera databases will be stored.

Configuration Settings

The following configuration settings are used to configure the connection to an existing HMS:

  • CATALOG_DB_ENGINE
  • CATALOG_DB_URL
  • CATALOG_DB_USER
  • CATALOG_DB_PASSWORD
  • CATALOG_DB_HMS_DB
  • ENABLE_HMS_2_SCHEMA

Configuring the Connection to an Existing HMS

To connect to an existing HMS, you will need to know the database server details where it is located. This follows the same instructions as when configuring a database.

For example, if your existing HMS is at hms.example.com:3306 with a username/password of hms/SecretPassw0rd! and the HMS database name is my_hms_db, the configuration will look like this:

CATALOG_DB_ENGINE: mysql
CATALOG_DB_URL: hms.example.example:3306
CATALOG_DB_USER: hms
CATALOG_DB_PASSWORD: SecretPassw0rd!
CATALOG_DB_HMS_DB: my_hms_db

HMS V2 Schema

HMS v1 and v2 have different database schemas, and Okera needs to be configured on which one to use. HMS v2 allows longer table property values to be specified (up to 16M characters now, an increase from 4K in earlier HMS releases).

To configure Okera to use the HMS v2 schema (only do this if your HMS is 2.0 or higher), set the following in your configuration file:

ENABLE_HMS_2_SCHEMA: "true"
By default, Okera uses the HMS v1 schema, so ENABLE_HMS_2_SCHEMA is set to false.