Connect to and manage Hive Metastore databases in Microsoft Purview
This article outlines how to register Hive Metastore databases, and how to authenticate and interact with Hive Metastore databases in Microsoft Purview. For more information about Microsoft Purview, read the introductory article.
The supported Hive versions are 2.x to 3.x. The supported platforms are Apache Hadoop, Cloudera, and Hortonworks. If you want to scan Azure Databricks, you are suggested to use the Azure Databricks connector which is more compatible and user friendly.
When scanning Hive metastore source, Microsoft Purview supports:
Extracting technical metadata including:
- Tables including the columns, foreign keys, unique constraints, and storage description
- Views including the columns and storage description
Fetching static lineage on assets relationships among tables and views.
When setting up scan, you can choose to scan an entire Hive metastore database, or scope the scan to a subset of schemas matching the given name(s) or name pattern(s).
When object is deleted from the data source, currently the subsequent scan won't automatically remove the corresponding asset in Microsoft Purview.
You must have an Azure account with an active subscription. Create an account for free.
You must have an active Microsoft Purview account.
You need Data Source Administrator and Data Reader permissions to register a source and manage it in the Microsoft Purview governance portal. For more information about permissions, see Access control in Microsoft Purview.
Set up the latest self-hosted integration runtime. For more information, see Create and configure a self-hosted integration runtime.
Ensure JDK 11 is installed on the machine where the self-hosted integration runtime is installed. Restart the machine after you newly install the JDK for it to take effect.
Ensure that Visual C++ Redistributable (version Visual Studio 2012 Update 4 or newer) is installed on the machine where the self-hosted integration runtime is running. If you don't have this update installed, download it now.
Download the Hive Metastore database's JDBC driver on the machine where your self-hosted integration runtime is running. For example, if the database is mssql, download Microsoft's JDBC driver for SQL Server. Note down the folder path that you'll use to set up the scan.
The driver should be accessible by the self-hosted integration runtime. By default, self-hosted integration runtime uses local service account "NT SERVICE\DIAHostService". Make sure it has "Read and execute" and "List folder contents" permission to the driver folder.
This section describes how to register a Hive Metastore database in Microsoft Purview by using the Microsoft Purview governance portal.
The only supported authentication for a Hive Metastore database is Basic Authentication.
Open the Microsoft Purview governance portal by:
Select Data Map on the left pane.
In Register sources, select Hive Metastore > Continue.
On the Register sources (Hive Metastore) screen, do the following:
For Name, enter a name that Microsoft Purview will list as the data source.
For Hive Cluster URL, enter a value that you get from the Ambari URL. For example, enter hive.azurehdinsight.net.
For Hive Metastore Server URL, enter a URL for the server. For example, enter sqlserver://hive.database.windows.net.
Select a collection from the list.
To troubleshoot any issues with scanning:
Use the following steps to scan Hive Metastore databases to automatically identify assets. For more information about scanning in general, see Scans and ingestion in Microsoft Purview.
In the Management Center, select integration runtimes. Make sure that a self-hosted integration runtime is set up. If it isn't set up, use the steps in Create and manage a self-hosted integration runtime.
Go to Sources.
Select the registered Hive Metastore database.
Select + New scan.
Provide the following details:
Name: Enter a name for the scan.
Connect via integration runtime: Select the configured self-hosted integration runtime.
Credential: Select the credential to connect to your data source. Make sure to:
- Select Basic Authentication while creating a credential.
- Provide the Metastore username in the appropriate box.
- Store the Metastore password in the secret key.
For more information, see Credentials for source authentication in Microsoft Purview.
Metastore JDBC Driver Location: Specify the path to the JDBC driver location in your machine where self-host integration runtime is running, for example,
D:\Drivers\HiveMetastore. It's the path to valid JAR folder location. The value must be a valid absolute file path and does not contain space. Make sure the driver is accessible by the self-hosted integration runtime, learn more from prerequisites section.
Metastore JDBC Driver Class: Provide the class name for the connection driver. For example, enter \com.microsoft.sqlserver.jdbc.SQLServerDriver.
Metastore JDBC URL: Provide the connection URL value and define the connection to the URL of the Metastore database server. For example:
When you copy the URL from hive-site.xml, remove
amp;from the string or the scan will fail.
Download the SSL certificate to the self-hosted integration runtime machine, then update the path to the SSL certificate's location on your machine in the URL.
When you enter local file paths in the scan configuration, change the Windows path separator character from a backslash (
\) to a forward slash (
/). For example, if you place the SSL certificate at local file path D:\Drivers\SSLCert\BaltimoreCyberTrustRoot.crt.pem, change the
serverSslCertparameter value to D:/Drivers/SSLCert/BaltimoreCyberTrustRoot.crt.pem.
The Metastore JDBC URL value will look like this example:
Metastore database name: Provide the name of the Hive Metastore database.
Schema: Specify a list of Hive schemas to import. For example: schema1; schema2.
All user schemas are imported if that list is empty. All system schemas (for example, SysAdmin) and objects are ignored by default.
Acceptable schema name patterns that use SQL
LIKEexpression syntax include the percent sign (%). For example,
A%; %B; %C%; Dmeans:
- Start with A or
- End with B or
- Contain C or
- Equal D
NOTand special characters isn't acceptable.
Maximum memory available: Maximum memory (in gigabytes) available on the customer's machine for the scanning processes to use. This value is dependent on the size of Hive Metastore database to be scanned.
As a thumb rule, please provide 1GB memory for every 1000 tables.
For Scan trigger, choose whether to set up a schedule or run the scan once.
Review your scan and select Save and Run.
View your scans and scan runs
To view existing scans:
- Go to the Microsoft Purview portal. On the left pane, select Data map.
- Select the data source. You can view a list of existing scans on that data source under Recent scans, or you can view all scans on the Scans tab.
- Select the scan that has results you want to view. The pane shows you all the previous scan runs, along with the status and metrics for each scan run.
- Select the run ID to check the scan run details.
Manage your scans
To edit, cancel, or delete a scan:
Go to the Microsoft Purview portal. On the left pane, select Data Map.
Select the data source. You can view a list of existing scans on that data source under Recent scans, or you can view all scans on the Scans tab.
Select the scan that you want to manage. You can then:
- Edit the scan by selecting Edit scan.
- Cancel an in-progress scan by selecting Cancel scan run.
- Delete your scan by selecting Delete scan.
- Deleting your scan does not delete catalog assets created from previous scans.
Go to the asset -> lineage tab, you can see the asset relationship when applicable. Refer to the supported capabilities section on the supported Hive Metastore lineage scenarios. For more information about lineage in general, see data lineage and lineage user guide.
Now that you've registered your source, use the following guides to learn more about Microsoft Purview and your data: