Skip to main content

Apache Hive Metastore support

Hive Metastore is a relational database that is part of Apache Hive and stores all the metadata information on tables, columns, data types, etc. of HDFS clusters. It can be hosted on Apache Derby, MySQL, MariaDB, Oracle, SQL Server or AzureSQL, PostgreSQL. Dataedo provides a native connector to Hive Metastore database that allows to extract metadata about tables, views, and other database objects.

Not only Apache Hive can hold metadata in Hive Metastore, other platforms can do it too. Therefore you can use Hive Metastore connector to document:

Connector​

Supported Versions​

Hive Metastore 3.x

Supported Metadata​

  • Tables
    • Table type:
      • Managed Table
      • Index Table
      • External Table
    • Columns:
      • Data type
      • Nullable
      • Default value
      • Check constraint
      • Unique constraint
    • Primary keys
      • Columns
    • Foreign keys
      • Columns
    • Relations
  • Views
    • View type:
      • Materialized view
      • Virtual view
    • Columns (see Tables)

Data profiling​

Dataedo does not support data profiling in Hive Metastore.

Connect to Hive Metastore​

Get connection details of Hive Metastore database​

You can find all required details in hive-site.xml file which contains a configuration of Hive Metastore database connection. File is located in Hive installation directory in conf catalog. In most cases it will be: /etc/hive/conf/hive-site.xml. In this file you need to look for properties:

  • javax.jdo.option.ConnectionURL
  • javax.jdo.option.ConnectionUserName
  • javax.jdo.option.ConnectionPassword

You should find all of them in configuration element of hive-site.xml file.

<configuration>
...
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://10.10.10.10:3306/hive_metastore?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>Hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>verySecurePassword</value>
</property>
...
</configuration>

Once you have all the properties, you need to extract details:

  • javax.jdo.option.ConnectionUserName - Dataedo username.
  • javax.jdo.option.ConnectionPassword - Dataedo password.
  • javax.jdo.option.ConnectionURL - here you need to extract information from jdbc connection string which has format: jdbc:[database_engine]://[database_address]:[database_port]/[metastore_database]?others_options. Previous example of configuration uses MySQL jdbc connector, although others database engines follow convention.

In our example, collected data is:

  • database: mysql
  • host: 10.10.10.10
  • port: 3306
  • user: Hive
  • password: verySecurePassword
  • metastore_database: hive_metastore

Importing Metadata in Dataedo Portal​

Entry point​

To start the Metadata Import flow, make sure you have the Connection Manager role. Go to Connections and click Add connection, then pick the connector matching the database that hosts your metastore - Hive Metastore - MySQL, - MariaDB, - PostgreSQL, - SQL Server or - Azure SQL - to open the import wizard described in the following steps.

Add connection

Step 1. Host details​

Provide the name of the Connection, an optional description, and the address of the database hosting the metastore. Only the host fields differ between the five connectors:

ConnectorDefault portAdditional fields
MySQL3306SSL mode, Use SSH
MariaDB3306SSL mode, Use SSH
PostgreSQL5432SSL mode, Use SSH
SQL Server1433Connection mode
Azure SQL1433Connection mode

The example below uses MySQL; see Get connection details of Hive Metastore database above for where to find these values.

info

A Connection in Dataedo represents a saved configuration for accessing a data source.
It can be reused for future imports and scheduling.

Host details - MySQL
Host details for the other metastore databases
Host details - MariaDB
Host details - PostgreSQL
Host details - SQL Server
Host details - Azure SQL

Advanced settings is optional — you can leave it collapsed and the connection will run on any available agent with the global timeouts. Expand it if you want to restrict the connection to a specific agent or override the task timeouts.

Step 2. Credentials​

Choose credentials from the list of existing ones available for the selected connector, or add new credentials. These are the credentials of the metastore database, not of Hive itself.

Credentials

Step 3. Data Sources​

Portal reads the metastore and lists the Hive databases it contains, grouped by the DBMS database holding the metastore and by catalog.

info

During one import, you can read the metadata of up to 20 data sources. You can reuse the same connection to import more sources later.

  • you can select multiple Hive databases at once and use the search box to narrow down results
  • each selected database should be given a Display name, which will be visible in Dataedo
Data sources

Step 4. Objects to import​

For each selected Hive database, you can choose which object types to import - Tables and Views.

Objects to import

Use Advanced filters to include or exclude objects by name pattern and object type instead.

Advanced filters

Step 5. Schedule​

Configure the Metadata Import task for each source individually:

  • choose the metadata extraction options (Append only, Reimport all included objects)
  • run daily, on selected weekdays, or on specific days of the month
  • choose an exact time of execution
  • Task state:
    • Active - the task will run as scheduled
    • Draft - the task is saved but not executed until you switch it to Active
  • Run Immediately - when checked, the task will also be executed right after you click Create connection
useful tip

Only one source in a metadata import can have Run Immediately selected.

Add Import Metadata task

Once saved, the task appears next to its source in the schedule list.

Schedule with a defined task
caution

You must configure at least one import task for every data source.
If you skip this, an empty database will be created and no metadata will be imported.


Importing Metadata in Dataedo Desktop​

Add new connection​

To connect to Hive Metastore and create new documentation by clicking Add documentation and choosing Database connection.

Connection to SQL Server

On the connection screen choose Apache Hive Metastore as DBMS.

Hive Metastore selection

You need to select database engine hosting Hive Metastore:

Hive Metastore database

Connection details​

Then you need to provide connection details accordingly for selected database:

Following connection example will be based on MySQL, although others databases will have similar fields required for connection:

  • Host - hostname or IP address of server on which database is available,
  • Port - port under which database is available,
  • User - username,
  • Password - password,
  • Metastore database - name of MySQL database hosting the metastore. You can expand list of databases by clicking ... button.
  • Database - name of Hive database. You can expand list of databases by clicking ... button. You will get a table of Hive databases with Database Name, Description, Catalog Name and Catalog description columns:
Hive_dbs

Obtaining all details is described in chapter How to get connection details of Hive Metastore database.

Hive MySQL conn details

Importing metadata​

When connection was successful Dataedo will read objects and show a list of objects found. You can choose which objects to import. You can also use advanced filter to narrow down list of objects.

Hive Objects

Confirm list of objects to import by clicking Next.

Next screen allows you to change the default name of the documentation under which it will be visible in Dataedo repository.

Hive documentation name

Click Import to start the import. Once import is done, close import window with Finish button.

Outcome​

Your database has been imported to new documentation in the repository.

Hive documentation
Dataedo is an end-to-end data governance solution for mid-sized organizations.
Data Lineage • Data Quality • Data Catalog