> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Connect Apache Hadoop and Hive to Mammoth

> Connect Mammoth to Apache Hadoop through HiveServer2, import a Hive table or HiveQL query result as a dataset, and keep it refreshed daily.

The Apache Hadoop connector reads your cluster through HiveServer2, the standard SQL interface for Hadoop, and imports a Hive table or HiveQL query result as a dataset. Open it from **Data Library** > **New dataset** > **Connectors**, search for **Hadoop** and click **Apache Hadoop**. Project Admins create the connection; Project Editors can start datasets from a connection the project already has. Which connectors you can add depends on your plan.

## What you can bring in from Hadoop

- Any Hive table the user can read, grouped by schema.
- The result of your own HiveQL query.

The dataset can refresh daily or only when you ask.

## Before you connect Hadoop

You need:

- A Hadoop cluster running HiveServer2, reachable from the internet.
- HiveServer2 set up to accept username and password sign-in.
- A Hive user with `SELECT` access on the tables you want.
- The HiveServer2 hostname, port (default `10000`), database name, username and password.
- Mammoth's IP address allowed in your cluster's firewall. See [Allow Mammoth through your firewall](https://mammoth.io/docs/learn/get-data-in/network-requirements/).

## Connect Apache Hadoop to Mammoth

1. Go to the **Data Library**, click **New dataset**, and choose **Connectors**.
2. Search for **Hadoop** and click the **Apache Hadoop** tile. The connection form opens.
3. Fill in the fields below and click **Connect**. If the check fails, the error appears at the bottom of the form.
4. Once Mammoth has connected, the connector workspace opens on your tables. See [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/) for the shared steps.

| Field | What to enter | Example |
| --- | --- | --- |
| **Host URL** | Hostname or IP address of your HiveServer2 node | `hive.cluster.example.com` |
| **Port** | HiveServer2 TCP port | `10000` (default) |
| **Username** | Hive user with `SELECT` access | `mammoth_reader` |
| **Password** | Password for the Hive user | |
| **Database** | Name of the Hive database | `analytics` |
| **Display Name** | Optional label for this connection | `Hadoop Cluster Prod` |

## Query a Hive table with HiveQL

1. In **Tables**, click a table. Mammoth opens its rows with the `SELECT *` query that read them, shown above the rows.
2. To write HiveQL instead, click **Edit SQL**, edit the query, and click **Run**.

```sql
SELECT order_id, customer_id, amount, order_date
FROM analytics.orders
WHERE order_date >= '2024-01-01'
LIMIT 10000
```



AI query writing (**Write SQL**) isn't available for Hadoop. [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/) covers the full SQL view.

## Save Hadoop data as a dataset

1. Click **Save as dataset**.
2. Enter a **Name** and pick a folder.
3. Under **Keep it up to date**, choose **Daily at 06:00** or **Only when I ask**.
4. Next to the sentence that says what each refresh does, click **Change** and pick an option under **On each refresh** (see the table below).
5. Click **Save as dataset**.

| On each refresh | What it does |
| --- | --- |
| **Replace all rows** | Matches the source after every refresh |
| **Add only new rows** | Keeps what you have and adds rows above the last value of a **Key column** |
| **Add every row again** | Shown instead when the result has no numeric or date column, so each refresh adds a full copy |
| **Keep only the newest rows** | Empties the dataset, then brings in rows since the last refresh (needs a **Key column**) |

A key column is a column whose values only ever go up, such as an ID or a date.

## Refresh Hadoop data on a schedule

Choosing **Daily at 06:00** creates a [Dataset Refresh](https://mammoth.io/docs/learn/automate/refresh-a-dataset/) automation that you can reschedule later. After the dataset is saved, you can change what a refresh does in its **Update method**: **Replace all data**, **Add new rows only** or **Keep only the newest rows**.

## Troubleshoot Hadoop connections and slow Hive queries

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Connection fails | Port 10000 is closed to Mammoth | Open port 10000 inbound from Mammoth's IP address |
| Connection fails | The user can't read the database | Run a test query in Beeline from your cluster to check the user's access |
| Queries are slow | Large Hive scans take time | Use `LIMIT` while you explore, then remove it before you save so the full result is imported |

## Related

- [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/): the shared connector workspace steps and the full SQL view.
- [Allow Mammoth through your firewall](https://mammoth.io/docs/learn/get-data-in/network-requirements/): the IP address to allow.
- [Manage saved connections](https://mammoth.io/docs/learn/get-data-in/connections/): edit, reuse or delete this connection.
- [Refresh a dataset](https://mammoth.io/docs/learn/automate/refresh-a-dataset/): change when the dataset refreshes.
- [Speed up pipelines and connectors](https://mammoth.io/docs/learn/help/performance/): strategies for large tables.

---
Source: https://mammoth.io/docs/learn/get-data-in/connectors/hadoop.md · Updated: 2026-11-08
