Dataset
Amazon Redshift warehouse table datasets for AI training
An Amazon Redshift dataset is an unload of a business's warehouse: the fact and dimension tables in chosen schemas, their CREATE TABLE definitions with distribution and sort keys, the SQL of views, materialized views and stored procedures, and rows from SYS_QUERY_HISTORY where query history was kept. SourceX sources it to a buyer's spec from established businesses that run Amazon Redshift for their reporting. Each dataset is de-identified and licensed for an agreed permitted use, and it is not delivered before a signed agreement.
Dataset manifest
Sourced to your spec- What it is
- Unloaded fact and dimension tables from chosen Redshift schemas, with table DDL, view and procedure SQL, and query history where it was kept
- Typical systems
- Amazon Redshift provisioned clusters and Redshift Serverless workgroups, with Redshift Spectrum external schemas, datashares and audit logging in scope where agreed
- Typical history
- As deep as the tables the business loaded; query history only days unless audit logs or copies of the system views were kept
- Modality
- Typed table rows, with SQL text in table definitions, views, procedures and query logs
- Delivery formats
- Parquet or CSV files as UNLOAD wrote them, with their manifests, DDL as SQL text and logs as JSONL
- Preparation
- Specify that customer and employee identifiers are replaced the same way in every table so joins still work, and that literals in query text are masked
- Licensing
- Scoped per database, schema and table; check which tables arrived through datashares or purchased feeds, since the business may not have the right to license those
- Availability
- Sourced to your spec from businesses that run Amazon Redshift; supply is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| database_name | string | The Redshift database the object lives in, as SVV_TABLE_INFO reports it. |
| schema_name | string | The schema inside that database, which is the usual unit of scope for an unload. |
| table_name | string | The table, view, materialized view or procedure name as the catalog holds it. |
| object_type | enum | Table, view, late-binding view, materialized view, stored procedure or external table. |
| origin | enum | Whether the business loads the table itself, reads it through a datashare, or reaches it through an external schema. |
| table_ddl | string | The CREATE TABLE statement that SHOW TABLE returns, with column types, encodings, NOT NULL flags and declared keys. |
| dist_style | string | Distribution style from SVV_TABLE_INFO: EVEN, ALL, KEY on a named column or an AUTO variant. |
| sort_key | array | The sort key columns in order, taken from the table DDL. |
| declared_constraints | array | Primary key, foreign key and unique declarations from the DDL, each with counts showing whether the delivered rows satisfy it. |
| unload_manifest | object | File format, file list and row counts from the manifest UNLOAD wrote with the VERBOSE option. |
| definition_sql | string | The SQL text of a view, materialized view or stored procedure, null for plain tables. |
| external_location | string | For a table in an external schema, the Amazon S3 location that SVV_EXTERNAL_TABLES lists for it. |
| load_history | array | COPY commands recorded for the table in SYS_LOAD_HISTORY, with source path, rows loaded, status and time. |
| query_history | array | Statements from SYS_QUERY_HISTORY that touch the table, with type, status, timing and text reassembled from SYS_QUERY_TEXT. |
Field names from the table above; values are masked placeholders.
Example record
{
"database_name": "analytics",
"schema_name": "mart",
"table_name": "fact_order_line",
"object_type": "table",
"origin": "loaded_by_business",
"table_ddl": "CREATE TABLE mart.fact_order_line (\n order_line_id bigint NOT NULL ENCODE az64,\n order_id bigint NOT NULL ENCODE az64 distkey,\n customer_key character varying(64) ENCODE lzo,\n ordered_at timestamp without time zone ENCODE az64,\n net_amount numeric(12,2) ENCODE az64,\n PRIMARY KEY (order_line_id),\n FOREIGN KEY (customer_key) REFERENCES mart.dim_customer(customer_key)\n)\nDISTSTYLE KEY SORTKEY ( ordered_at );",
"dist_style": "KEY(order_id)",
"sort_key": [
"ordered_at"
],
"declared_constraints": [
{
"type": "primary_key",
"columns": [
"order_line_id"
],
"holds_in_delivery": false,
"duplicate_keys": 1184,
"note": "one file loaded by two COPY commands"
},
{
"type": "foreign_key",
"columns": [
"customer_key"
],
"references": "mart.dim_customer(customer_key)",
"holds_in_delivery": false,
"orphan_rows": 412
}
],
"unload_manifest": {
"format": "PARQUET",
"files": 16,
"row_count": 48211907,
"manifest_key": "mart/fact_order_line/manifest"
},
"load_history": [
{
"start_time": "2024-05-14T03:10:22Z",
"data_source": "s3://[BUCKET]/orders/2024/05/13/",
"loaded_rows": 41873,
"status": "success"
}
],
"query_history": [
{
"query_type": "SELECT",
"status": "success",
"elapsed_time_us": 8420311,
"query_text": "select date_trunc('month', ordered_at), sum(net_amount) from mart.fact_order_line group by 1"
}
]
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Text-to-SQL on a working star schema
Tables with their view SQL and logged queries give a model the join paths, naming habits and Redshift SQL dialect of a warehouse in daily use.
Relational and tabular model training
Typed Parquet tables that still join after de-identification support multi-table pretraining across facts and dimensions.
Data quality agents
Declared keys paired with measured duplicate and orphan counts are labeled examples of the defects an agent should find before it trusts a join.
Warehouse design assistants
Distribution and sort keys set beside the query history show where physical design matched the workload.
Evaluation of analytics agents
Questions over tables with a tested grain make test items where the naive query double counts and the careful one does not.
Use-case guides: Coding agents, Enterprise and computer-use agents, Private evaluation sets
What makes this data valuable
Constraints tested
Each declared key comes with duplicate and orphan counts measured on the delivered rows.
Verbose manifests
UNLOAD manifests list columns, types and rows per file, so completeness is checked by arithmetic.
Typed files
Parquet keeps numeric precision and nulls that delimited text can blur.
Definitions included
View, materialized view and procedure SQL explains how the reporting tables were derived.
Query history depth
Audit logs or saved system views that span months, with statement text reassembled.
Known origin
Load history or loader columns show which source system and S3 path fed each table.
Process
Amazon Redshift dataset
Declared keys are hints, so the grain has to be tested
Amazon Redshift lets a CREATE TABLE statement declare a primary key, a foreign key or a unique column, stores the declaration and prints it back from SHOW TABLE. It does not enforce any of them. Only NOT NULL is checked when rows are loaded. The query planner uses the declarations as hints, so a SELECT DISTINCT can return duplicate rows when a declared primary key is not unique. A fact table whose DDL promises one row per order line can therefore hold the same line twice, because two COPY commands loaded the same file, and a declared foreign key can point at dimension rows that were never loaded.
The true grain of a table is therefore a property of its rows, and the DDL is only a claim about it. A model trained on the unload learns from the duplicates, and a text-to-SQL test whose reference answer assumes uniqueness has two defensible answers. Tested and labeled, the same defects are useful, since they are what an agent meets in a working warehouse. The DDL also records intent. The distribution key is often the column the team expected to join on and the sort key the timestamp it expected to filter on, unless the table was left on AUTO, where Redshift picks them from the workload.
Redshift tables hold current rows. An UPDATE or DELETE leaves nothing to query afterward, and a cluster snapshot is a backup to restore, not a history to read. Change over time exists only where the business modeled it, as dimension tables with validity dates, append-only fact tables or daily snapshot tables. Every row is also a copy, and COPY can alter it on the way in: TRUNCATECOLUMNS cuts strings to the column width, ACCEPTINVCHARS replaces invalid UTF-8 characters, and MAXERROR lets a load finish while skipping rows it could not parse.
What UNLOAD writes and what stays behind
UNLOAD takes a SELECT statement, not a table name, and writes the result to Amazon S3 as a set of files. The default format is pipe-delimited text, with CSV, JSON and Parquet as options. None of them carries the table's DDL, so declared keys, distribution and sort keys, view SQL and stored procedure bodies are pulled from the catalog as a separate step. The format also changes the data. Delimited text writes a null as an empty string unless NULL AS is set, so nulls and empty strings merge. Parquet keeps column types but drops the time zone from TIMESTAMPTZ values. GEOMETRY and VARBYTE columns can be unloaded only to text or CSV, and PARTITION BY removes the partition columns from the files unless INCLUDE is given.
Three things sit outside an unload of the cluster. Tables in a Redshift Spectrum external schema are files in S3 registered in a data catalog, and SVV_EXTERNAL_TABLES lists where they are. A late-binding view can union a local table with an external one, so a view may return rows that no local table holds. A database created from a datashare is queried like a local one, but its tables are stored by the producer, which may be another account or a data vendor. Query history is short: the STL and SYS views keep only days of it, so a longer record exists only where audit logging to S3 or CloudWatch was turned on with the user activity log enabled, or where the team copied the system views into its own tables.
Test a sample with counts. Ask for files written with MANIFEST VERBOSE, which records column names, types and the row count of each file, and compare the totals with the owner's count on the source table. For each declared primary key compare COUNT with COUNT DISTINCT, and for each foreign key run an anti-join. Check one nullable text column for empty strings, and compare SVV_EXTERNAL_TABLES and SVV_DATASHARES with what was delivered.
What to check before licensing
- Have the data owner and your counsel check the Amazon Web Services terms that apply to the account on exported data and API use.
- Ask which tables the business loads itself and which arrive through datashares, AWS Data Exchange subscriptions or purchased feeds.
- For every declared primary and foreign key, ask for the duplicate and orphan counts in the delivered rows.
- Confirm how each file was written: the format, the NULL AS setting for delimited text, and whether a MANIFEST VERBOSE file with row counts comes with it.
- Ask for the list of external schemas and whether the S3 files behind the Redshift Spectrum tables that in-scope views read are part of the delivery.
- Ask where query history comes from, its first and last timestamp, and how literal values in statement text were masked.
- Confirm that consolidated customer data is de-identified with the same key mapping in every table, and that free-text columns were screened.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
What does an Amazon Redshift dataset contain?
It contains the rows of chosen tables with the definitions that explain them. A typical scope is the fact and dimension tables of one or more schemas as Parquet, the CREATE TABLE text with distribution and sort keys, view and stored procedure SQL and, where it was kept, query history. You specify the schemas, date range and row volume, and supply is not guaranteed.
Can I rely on the primary and foreign keys in the table DDL?
No, not without testing them. Redshift stores primary key, foreign key and unique declarations but does not enforce them, so a table can declare a key and still hold duplicate keys or rows that reference nothing. Ask for the duplicate and orphan counts per declared constraint, and decide whether you want the defects kept and labeled or removed.
How much query history comes with a Redshift dataset?
Often only days, unless the business planned for more. The STL and SYS system views drop queries after a short period. Longer history exists where audit logging delivered the user activity log to Amazon S3 or CloudWatch, or where the data team copied SYS_QUERY_HISTORY and SYS_QUERY_TEXT into its own tables. Ask for the first and last query timestamp before scoping.
Are Redshift Spectrum external tables part of the unload?
Not unless you ask for them. An external table is a definition in a data catalog that points at files in Amazon S3, and Redshift reads those files at query time without storing the rows in the cluster. If views in scope read an external schema, request the S3 files behind it as a separate item.
Which tables in a warehouse can the business license?
Only the ones it has the right to share, which may not be the whole warehouse. Tables loaded from the business's own operating systems are the usual scope. Tables that arrive through a datashare, an AWS Data Exchange subscription or a purchased feed may belong to another party, and whether they can be included is a question for the business and counsel under that party's terms. Ask for the origin of every table in the manifest.
Is SourceX affiliated with Amazon Web Services?
Amazon Redshift is named to identify the system the records come from. That does not imply a partnership with or endorsement by Amazon Web Services. The records belong to the business that runs Amazon Redshift, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Relational business database exports
Populated relational databases from business applications, with schema, keys, constraints, code tables and a data dictionary
- SQL query logs paired with the business question
Analyst-run warehouse queries in session order, each with schema, run outcome and the paired business question
- Snowflake warehouse tables
Raw and modeled tables, views, VARIANT columns, task and procedure definitions and optional query history from one Snowflake account
- BigQuery datasets and tables
Extracts of chosen datasets and tables with their schemas, plus view, routine and scheduled query SQL and job history where wanted
- Amazon S3 bucket contents
Objects copied from chosen buckets or prefixes, with keys, metadata, tags, storage classes and, where versioning was on, noncurrent versions and delete markers
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.