> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Redshift external table gem

> Read and write from Redshift

export const execution_engine_0 = "Prophecy Automate"

<Info>This gem runs in {execution_engine_0}.</Info>

## Overview

The Redshift Source and Target gems let you connect Prophecy pipelines to Amazon Redshift tables for reading and writing data. This page outlines how to configure Redshift sources and targets using the appropriate connections, locations, and properties.

## Create a Redshift gem

To create a Redshift Source or Target gem in your pipeline:

<Steps>
  <Step title="Add a Source or Target gem to the pipeline">
    1. Open your pipeline in the [Studio](/data-analysis/development/studio/studio).
    2. Click on **Source/Target** in the canvas.
    3. Select **Source** or **Target** from the dropdown.
    4. Click on the gem to open the configuration.
  </Step>

  <Step title="Select Redshift format">
    In the **Type** tab, select **Redshift**. Then, click **Next**.
  </Step>

  <Step title="Set location details">
    In the **Location** tab, set your connection details and table location. To learn more, jump to [Source location](#source-location) and [Target location](#target-location).
  </Step>

  <Step title="Set table properties">
    In the **Properties** tab, set the table properties. To learn more, jump to [Source
    properties](#source-properties) and [Target properties](#target-properties).
  </Step>

  <Step title="Preview data (Source only)">
    In the **Preview** tab, load a sample of the data and verify that it looks correct.
  </Step>
</Steps>

## Source configuration

Use these settings to configure a Redshift Source gem for reading data.

### Source location

| Parameter                   | Description                                                                                                                        |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Format type                 | Table format for the source. For Amazon Redshift tables, set to `redshift`.                                                        |
| Select or create connection | Select or create a new [Redshift connection](/data-analysis/environment/connections/redshift) in the Prophecy fabric you will use. |
| Database                    | Database containing the table you want to read from.                                                                               |
| Schema                      | Schema within the database where the table is located.                                                                             |
| Name                        | Exact name of the Amazon Redshift table to read data from.                                                                         |

### Source properties

Infer or manually configure the schema of your Source gem. Optionally, add a description for your table. Additional properties are not supported at this time.

## Target configuration

Use these settings to configure a Redshift Target gem for writing data.

### Target location

| Parameter                   | Description                                                                                                                               |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Format type                 | Table format for the source. For Amazon Redshift tables, set to `redshift`.                                                               |
| Select or create connection | Select or create a new [Amazon Redshift connection](/data-analysis/environment/connections/redshift) in the Prophecy fabric you will use. |
| Database                    | Database where the target table will be created or updated.                                                                               |
| Schema                      | Schema within the database where the target table resides or will be created.                                                             |
| Name                        | Name of the Amazon Redshift table to write data to. If the table doesn't exist, it will be created automatically.                         |

### Target properties

| Property    | Description                                                                                          | Default |
| ----------- | ---------------------------------------------------------------------------------------------------- | ------- |
| Description | Description of the table.                                                                            | None    |
| Write Mode  | Whether to overwrite the table, append new data to the table, or throw an error if the table exists. | None    |
