> For the complete documentation index, see [llms.txt](https://docs.telm.ai/telmai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.telm.ai/telmai/connect-to-data/data-connections/iceberg.md).

# Hive Metastore

Connect Telmai to Hive Metastore.

Telmai reads Hive and Iceberg tables registered in a Hive Metastore, with the data files in Google Cloud Storage or AWS S3.

{% hint style="info" %}
Available on GCP and AWS deployments only.
{% endhint %}

## Before you connect

1. Make sure Telmai can reach the metastore's Thrift endpoint. If it's behind a firewall, allow Telmai's addresses. See [IP Allowlist](https://docs.telm.ai/telmai/api-reference/telmai-ip-list.md).
2. Set up access to the warehouse storage:
   * **GCS:** a service account with read access to the Hive Metastore warehouse. On a private-cloud deployment, the service account also needs write access to Telmai's internal storage bucket. On GCP deployments, Telmai can use its tenant service account instead.
   * **S3:** an IAM user's access key and secret key with read access to the warehouse bucket.

## Connection fields

On the **Connections** page, click **Add connection** and choose **Hive Metastore**. See [Add a connection](https://docs.telm.ai/telmai/connect-to-data.md#add-a-connection) for the full flow.

| Field                                                                                | Description                                                                                        |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| **Thrift URI**                                                                       | The metastore's Thrift URI, for example `thrift://metastore.example.com:9083`.                     |
| **Location type**                                                                    | Where the data files are: **GCS** or **S3**.                                                       |
| **Catalog type**                                                                     | **HIVE** for a standard Hive catalog, or **ICEBERG** for an Iceberg catalog in the Hive Metastore. |
| **HMS Version**                                                                      | The Hive Metastore version: **2.x**, **3.x** or **4.x**.                                           |
| **Region**                                                                           | The AWS region of the S3 bucket, for example `us-east-1`.                                          |
| **Client email**, **Client ID**, **Project ID**, **Private key ID**, **Private key** | The values from the GCS service account's JSON key.                                                |
| **Access key**, **Secret key**                                                       | The AWS access key ID and secret access key.                                                       |

**HMS Version** appears only when **Catalog type** is **HIVE**, and **Region** only when **Location type** is **S3**. Under **Credentials**, the service account fields appear for **GCS** and the key fields for **S3**. On GCP deployments, Telmai uses the tenant service account shown next to **Using:** instead of service account fields. On private-cloud GCP deployments, choose **Use tenant service account** or **Use credentials**.

## Asset fields

Click **Add assets** on the connection. See [Add assets](https://docs.telm.ai/telmai/connect-to-data.md#list-of-connectors-enabled-by-default).

| Field        | Description                                                   |
| ------------ | ------------------------------------------------------------- |
| **Database** | The Hive database that holds the tables, for example `sales`. |

Then choose **Existing table** or **Custom query**; see [Connection Modes](https://docs.telm.ai/telmai/connect-to-data/connection-modes.md). **Custom query** is available only when the connection's **Catalog type** is **HIVE**.
