Skip to main content
How to Set up Hive
Updated over a week ago

Use this connector to have Foundational scan and determine lineage and downstream impact for Hive.

This setup should take 5 minutes.

Permissions: You'll need to be a Hive admin for this setup
​
​Foundational will only access metadata and does not query data

In order to provide Foundational access to Hive, please follow these steps below and provide access to the underlying Postgres SQL database of Hive:

1. Create User and Grant Permissions to Metastore Database

You can access the PostgreSQL database through your preferred PostgreSQL client. The command line presented here are using psql

  1. Connect to your PostgreSQL database, using the following command:

    psql -h <host> -p 5432 -U <admin-user>

    By default Postgres will be in port 5432 under your Hive host.
    ​

  2. Switch to the Hive Metastore database:
    (metastore is the default name for Hive Metastore. If you use a different name in your Hive deployment, please use your metastore name):

    \connect metastore

  3. Use the script below to create a user named foundational and grant necessary permissions to a role named Foundational-role. Just change <password> to your password and run this script:

    CREATE USER foundational WITH PASSWORD '<password>'; 
    CREATE ROLE "Foundational-role";
    GRANT "Foundational-role" TO foundational;
    GRANT CONNECT ON DATABASE metastore TO "Foundational-role";
    GRANT USAGE ON SCHEMA public TO "Foundational-role";
    GRANT SELECT ON "COLUMNS_V2", "SDS", "TBLS", "DBS" TO "Foundational-role";
    GRANT SELECT ("COLUMN_NAME", "TYPE_NAME", "INTEGER_IDX", "CD_ID") ON "COLUMNS_V2" TO "Foundational-role";
    GRANT SELECT ("INPUT_FORMAT", "LOCATION", "SD_ID") ON "SDS" TO "Foundational-role";
    GRANT SELECT ("TBL_NAME", "TBL_TYPE", "SD_ID", "DB_ID") ON "TBLS" TO "Foundational-role";
    GRANT SELECT ("NAME", "DESC", "CTLG_NAME", "DB_ID") ON "DBS" TO "Foundational-role";

  4. Verify roles and users were created properly, by runnuing the following queries, and verifying they return the role name and user name

    SELECT rolname FROM pg_roles WHERE rolname = 'Foundational-role'; SELECT usename FROM pg_user WHERE usename = 'foundational';

2. Setup in Foundational

  1. Open the Connectors page in Foundational and select the Hive connector

  2. Fill in the following information:

    1. Hive Metastore DB Host: host address of the Hive Metastore Database.

    2. Hive Metastore DB port: port number for the Hive Metastore Database

    3. Hive Metastore DB name: If you have a custom name for the Hive Metastore Database, provide it here. The default name is metastore.

    4. User Name: username for foundational to connect to your PostgreSQL behind Metastore. If you used the script n this guide, the name is foundational

    5. Password: password for the foundational username (which you picked above when running the script).


      ​

Did this answer your question?