Connect Amazon Redshift to Mammoth and import tables
The Amazon Redshift connector imports a table, or the result of your own SQL query, from a Redshift cluster into Mammoth as a dataset. It connects through a connection form, then opens in the connector workspace's SQL view. Open it from Data Library > New dataset > Connectors and click Amazon Redshift. 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 Redshift
- Any table the database user can read.
- The result of your own
SELECTquery.
AI query writing (Write SQL) isn't available for Redshift. Redshift supports a key column, so a refresh can add only new rows.
Before you connect Amazon Redshift
You need:
- A Redshift cluster reachable from the internet.
- A database user with
SELECTaccess to the tables you want to import. - The cluster's endpoint hostname, port (default
5439), database name, username and password. - Mammoth's IP address allowed in the cluster's security group. The connection form shows the address. See Allow Mammoth through your firewall.
Connect Amazon Redshift to Mammoth
- Go to the Data Library, click New dataset, and choose Connectors.
- Search for Amazon Redshift and click its tile. The connection form opens. See Connect a database or app for the shared steps.
- Fill in the connection form (see the table below).
- Click Connect. The connector workspace opens on your tables.
| Field | What to enter |
|---|---|
| Host URL | The cluster endpoint hostname |
| Port | Default 5439 |
| Username | Database user with read access |
| Password | That user's password |
| Database | Name of the database to read |
| Display Name | Optional label for this connection in Mammoth |
Query a Redshift table in the SQL view
- In Tables, click a table. Mammoth opens its rows with the
SELECTquery that read them. - To change what you import, click Edit SQL, edit the query, and click Run (or press Ctrl+Enter).
- To keep only some columns, tick them in the table header.
Connect a database or app covers the SQL view and each refresh option.
Save Redshift data as a dataset
- Click Save as dataset.
- Enter a Name and choose a folder under Save in.
- Under Keep it up to date, choose Daily at 06:00 or Only when I ask.
- Under On each refresh, click Change and pick Replace all rows (the default), Add only new rows or Keep only the newest rows. Add every row again shows instead of Add only new rows when the query has no column that can serve as a key column.
- Click Save as dataset. When the dataset is ready, click Open dataset.
Refresh Redshift data and add only new rows
Choosing Daily at 06:00 creates a Dataset Refresh automation that you can reschedule later.
After you save, the dataset's Update method offers:
| Update method | What it does |
|---|---|
| Replace all data | Rebuilds the dataset from the source on every refresh |
| Add new rows only | Keeps your rows and adds rows above the last value of a Key column |
| Keep only the newest rows | Empties the dataset, then brings in rows since the last refresh |
Pick a key column whose values only go up, such as an ID or a date.
Troubleshoot Redshift connections
| Symptom | Likely cause | Fix |
|---|---|---|
| Connection fails | The security group blocks Mammoth, or the cluster isn't public | Allow Mammoth's IP address in the cluster's security group, and check the cluster is publicly reachable |
| A table is missing | The user lacks SELECT on it | Grant the database user SELECT on the table |
Related
- Connect a database or app: the shared connector workspace steps and refresh options.
- Allow Mammoth through your firewall: the IP address to allow.
- Manage saved connections: edit, reuse or delete this connection.
- Refresh a dataset: change when the dataset refreshes.
- Speed up pipelines and connectors: incremental refresh for large tables.
Something wrong? support@mammoth.io