Area: Ingestion
Sub-Area: Redshift
Applies to: OSS + Cloud
Issue
Redshift ingestion shows databases in DataHub that you did not ingest (phantom databases). Or the Redshift connection fails. Or manual lineage to Redshift datasets does not match the datasets you ingested.
You Might Be Asking
- Why do databases I never ingested appear in DataHub?
- Will restricting the service account's access to other databases remove them?
- Why does my manual lineage point to a different dataset than the one I ingested?
- Where do I put driver or IAM settings for the Redshift connection?
Cause
-
Datashare lineage. Datashare lineage is on by default (
include_share_lineage). When the ingested database is a shared (consumer) database, DataHub generates lineage from the database's inbound share. The producer database can then show up through that lineage. Changing the service account's database access is not the fix for this. -
Different
platform_instancevalues. Dataset URNs include the recipe'splatform_instanceandenv. Recipes for databases in the same Redshift namespace (or provisioned cluster) must use the sameplatform_instance. Different values create separate sets of datasets. -
Manual lineage with the wrong URN. Because
platform_instanceandenvare part of the URN, manual lineage written without them points to a different dataset than the one the recipe ingests.
Solution
-
Ingest one database per recipe. If a Redshift namespace (or provisioned cluster) has several databases, run a separate ingestion for each database.
-
Use the same
platform_instancewithin a namespace. Give every recipe for the same namespace (or provisioned cluster) the sameplatform_instance. If you ingest several namespaces, set aplatform_instancethat is unique per namespace.
source:
type: redshift
config:
database: "prod_db"
platform_instance: "my_namespace"
# ... connection settings
-
Handle datashare lineage. If a database appears only through datashare lineage, ingest the producer namespace at least once so the lineage shows correctly. If you do not want datashare lineage, set
include_share_lineage: False. If share information is missing, the run warns "Upstream lineage of inbound datashare will be missing". Datashare lineage needs SELECT onsvv_datashares, plus SHARE privileges on the datashares in both the producer and consumer namespaces. Shared (consumer) databases also need SELECT onsvv_redshift_tablesandsvv_redshift_columns. -
Fix connection failures. The connection takes host, port, user, database and password from the recipe. Other driver arguments, including IAM authentication settings, go under
extra_client_options. Keys underoptionsare not passed to the Redshift connection. They go to SQLAlchemycreate_engine, which the profiler uses. Check theextra_client_optionsentry in the config details. Also check that the service account has the grants in the Redshift prerequisites. -
Fix manual lineage. Build the Redshift dataset URN with the same
platform_instanceandenvas the recipe. A URN without them does not match datasets ingested with them.
Related Documentation
- Ingestion of multiple Redshift databases/namespaces
- Redshift datashare lineage
- Redshift prerequisites
- Redshift config details
Tags: redshift, connector, phantom-database, troubleshooting