Amazon Redshift connector
AWS data warehouse for SQL queries, schemas, and analytical data.
Use this as an implementation starting point: adapt the worked example to the requested dataset and the source documentation. See Custom API for the shared SDK pattern and document-upload workflow.
What this connector is for
AWS data warehouse for SQL queries, schemas, and analytical data.
Use this guide to choose the resources and row meanings for a Vortexify source integration. Connection ownership belongs to a connector; each dataset gets its own sync, configuration, and extraction behavior.
Data and tables you can pull
The following table families are a starting point for source selection. They describe possible datasets to implement using the vendor reference, not a guarantee that the example implements every table. Actual availability depends on the product edition, deployment, account permissions, and API/schema version.
| Suggested table | One row represents |
|---|---|
schemas | a schema |
tables | a table |
views | a view |
query_rows | a query result row |
Relationships and extraction considerations
These are proposed dataset names, not a universal schema guaranteed by the vendor. Preserve source object IDs and relationship references, and split nested child collections into separate tables when appropriate. Choose the concrete endpoint/report and row meaning from the vendor reference before implementing a sync.
Connecting to Amazon Redshift
Set service_name to redshift-data for the Data API. Subsequent statement calls need the cluster/workgroup, database, and IAM/secret-based authorization appropriate to the deployment; poll statement completion before reading results.
The example's config keys show the connection fields it uses. Store credentials in platform configuration marked as secret; host/project/database identifiers are ordinary connection settings. Environment and network access must match the selected source.
requirements.in
Declare these packages in the resource's requirements.in. Use the published vortexify package for the SDK and the source-specific driver/client shown below. Choose compatible dependency versions for your runtime; the connector and sync reference explains where each file belongs.
vortexify==0.1.1
pandas>=2,<3
boto3Set service_name to redshift-data for the Data API. Subsequent statement calls need the cluster/workgroup, database, and IAM/secret-based authorization appropriate to the deployment; poll statement completion before reading results.
Worked example: Data API query result pages
This source-read pattern shows how to shape the selected resource into DataFrames. Use it inside the dataset sync, retaining shared connection ownership in the connector. Its scope is the named resource and filters; adapt the projection, batching, and preview to the requested table.
Connection factory
Use this client in the owning connector's client() method and release it in close().
import boto3
def make_client(config: dict):
return boto3.client(
config["service_name"],
region_name=config["region"],
aws_access_key_id=config.get("access_key_id"),
aws_secret_access_key=config.get("secret_access_key"),
aws_session_token=config.get("session_token"),
)Source read
import time
import pandas as pd
def read_batches(client, config):
# statement_options contains Database and ClusterIdentifier or WorkgroupName,
# plus SecretArn when that auth path requires it. SQL is a reviewed SELECT.
statement_id = client.execute_statement(
Sql=config["select_sql"], **config["statement_options"]
)["Id"]
deadline = time.monotonic() + 120
while True:
status = client.describe_statement(Id=statement_id)
if status["Status"] == "FINISHED":
break
if status["Status"] in {"FAILED", "ABORTED"}:
raise RuntimeError(status.get("Error", status["Status"]))
if time.monotonic() >= deadline:
raise TimeoutError(f"Redshift statement {statement_id} is still running")
time.sleep(1)
for page in client.get_paginator("get_statement_result").paginate(Id=statement_id):
columns = [column["name"] for column in page["ColumnMetadata"]]
rows = [
[
None if field.get("isNull") else next(iter(field.values()))
for field in record
]
for record in page["Records"]
]
if rows:
yield pd.DataFrame(rows, columns=columns)What to adapt
Use service_name=redshift-data and authorized database/IAM credentials. The polling timeout does not cancel the remote query; inspect or explicitly cancel its statement before retrying. get_statement_result returns typed cells, which this example decodes into Python values. A preview uses a separate bounded SELECT.
Use the custom API SDK starting point to connect the read operation to Connector and Sync. For a source with its own driver, retain that client in Connector.client() and replace the HTTP request with the driver read. An extract(*, avg_row_size_bytes=None) implementation yields bounded DataFrames. An independent preview() uses a fresh connector and a small read; it must not call extraction or advance real state.
Choose explicit output columns and stable IDs for the requested table. The examples use json_normalize where useful to illustrate row shaping; nested arrays still need deliberate child tables and a stable declared output schema. A first-page sample is useful for development, while a full sync must follow all relevant continuation/parent-resource paths. Design incremental watermarks, update/deletion behavior, and rate-limit handling for the actual source before enabling incremental mode.
The purpose is to give a coding agent a concrete pattern to adapt, including for similar sources. These snippets are examples rather than a claim of complete vendor coverage. Check the source operation reference and representative responses before running with a customer's account; live vendor execution has not been verified here.
Sources and further reading
- Vendor connection and resource reference — The interface/access prerequisites underlying this connection path; follow the selected resource's documentation for fields, queries, and pagination.
- Vortexify connectors and syncs — Connector ownership, schemas, preview isolation, extraction, and checkpoint contracts.
- Vortexify CLI workflow — Registering resources, committing source, and providing credential configuration.