Area: Ingestion
Sub-Area: Redshift
Issue
When ingesting from Redshift, external tables (Spectrum tables) that reference S3 data are either not being discovered or showing incomplete metadata. This occurs because Spectrum tables require additional permissions and configuration to access both Redshift and the underlying S3/Glue metadata.
You Might Be Asking:
- How do I ingest Redshift Spectrum tables?
- Why are my external tables missing metadata?
- Do I need separate S3/Glue ingestion for Spectrum?
Solution
- Configure Redshift source to include Spectrum tables:
Example for Redshift. This can be adapted for other data warehouse platforms with external table support.
source:
type: redshift
config:
host_port: "redshift-cluster.region.redshift.amazonaws.com:5439"
database: "your_database"
username: "${REDSHIFT_USER}"
password: "${REDSHIFT_PASSWORD}"
# Enable external schema discovery
include_external_tables: true
# Optionally include specific external schemas
schema_pattern:
allow: ["^external_.*", "^spectrum_.*"]
- Grant necessary permissions for Spectrum:
Example for Redshift. This can be adapted for other data warehouse platforms with external table support.
-- In Redshift
GRANT USAGE ON SCHEMA spectrum_schema TO datahub_user;
GRANT SELECT ON ALL TABLES IN SCHEMA spectrum_schema TO datahub_user;
-- Ensure the Redshift role has S3/Glue access
-- This is typically configured at the Redshift cluster level
- For complete metadata, consider dual ingestion:
Example for Redshift with AWS Glue. This can be adapted for other data warehouse platforms with external table support.
# Ingest Redshift (includes Spectrum table references)
---
source:
type: redshift
config:
include_external_tables: true
# Separately ingest from Glue for detailed S3 metadata
---
source:
type: glue
config:
aws_region: "us-east-1"
extract_transforms: true
- Verify Spectrum table visibility:
Example for Redshift. This can be adapted for other data warehouse platforms with external table support.
-- Test Spectrum access directly
SELECT * FROM svv_external_tables;
SELECT * FROM svv_external_columns WHERE schemaname = 'spectrum_schema';
- Configure lineage between Redshift and S3:
Example for Redshift. This can be adapted for other data warehouse platforms with external table support.
source:
type: redshift
config:
# This will attempt to extract S3 locations
include_table_lineage: true
include_view_lineage: true
Additional Notes
Spectrum tables are Redshift external tables that query data directly in S3. The metadata is stored in AWS Glue Data Catalog, so consider ingesting from both Redshift and Glue for complete visibility.
Related Documentation
Tags:
redshift, spectrum, external-tables, s3, glue, aws, ingestion, lineage, data-lake