Area: UI Issues Sub-Area: Siblings Applies to: OSS + Cloud
Issue
DataHub links dbt datasets and warehouse datasets as siblings. You need to inspect those links, add a link by hand, change which sibling is primary, or work out why a link or its metadata looks wrong.
You Might Be Asking
- How do I see which sibling is primary?
- How do I link two datasets as siblings by hand?
- How do I make the warehouse table primary instead of dbt?
- Is lineage merged across siblings?
- Can I use
addSiblingsorremoveSiblingsGraphQL mutations?
Cause
By default, dbt is the primary sibling. The dbt recipe option dbt_is_primary_sibling defaults to true. When you set it to false, the warehouse (target platform) entities are primary.
An earlier version of this article used addSiblings and removeSiblings GraphQL mutations. Don't use them to manage siblings. Use the CLI, the Python patch builder or the dbt recipe option below.
Solution
Inspect sibling metadata with GraphQL
Run this in the GraphQL Explorer (GraphiQL). See How to set up GraphQL.
query GetDatasetSiblings {
entities(urns: ["urn:li:dataset:(urn:li:dataPlatform:dbt,my_project.customers,PROD)"]) {
urn
... on Dataset {
siblings {
isPrimary
siblings {
urn
type
}
}
siblingsSearch(input: { query: "*", count: 10 }) {
total
searchResults {
entity {
urn
type
}
}
}
}
}
}
Notes on this query:
-
entitiesreturns theEntityinterface. Type-specific fields such assiblingsmust sit inside an inline fragment like... on Dataset { ... }. -
siblings.siblingsis a list of entities, not URN strings. It needs a subselection such as{ urn type }. -
siblingsSearchtakes a scroll input.queryis required and there is nostartfield.siblingsSearch(input: { start: 0, count: 10 })fails validation.
See the GraphQL query reference.
Link two datasets by hand
Run the CLI command. The --urn entity becomes primary and the --sibling-urns entities become non-primary. The command reads each entity's existing siblings and adds the new ones.
datahub dataset add_sibling --urn PRIMARY_URN --sibling-urns SECONDARY_URN
Repeat --sibling-urns to add more than one sibling. If the CLI doesn't recognize the command, run datahub dataset --help and use a recent CLI. See add_sibling.
For scripts, DatasetPatchBuilder (in datahub.specific.dataset) has add_sibling(sibling_urn, primary=False), remove_sibling(sibling_urn) and set_siblings(sibling_urns, primary=False). These write patches, so adding or removing one sibling leaves the others in place. Prefer them over writing the whole siblings aspect.
Do not call emit_mcp(entityUrn=..., aspectName=..., aspect=...). emit_mcp takes a single MetadataChangeProposalWrapper (or MetadataChangeProposal) as its first argument. The siblings aspect class is SiblingsClass, not Siblings.
Make the warehouse table primary
Set dbt_is_primary_sibling: false in the dbt recipe. This is the lasting fix, because the dbt source emits a sibling patch on the warehouse entity on every run. With the option at true, that patch sets primary=false. With the option at false, it sets primary=true. The option is marked Experimental and needs DataHub server 1.3.0 or later. See the dbt source docs.
You can also run datahub dataset add_sibling with --urn set to the warehouse dataset. That marks it primary, but the next dbt ingestion with dbt_is_primary_sibling: true can undo it. Change the recipe option to keep the result.
A link is missing
- Confirm both datasets exist in DataHub.
- Check the dbt source settings
target_platformandtarget_platform_instance. See the dbt source docs. - Automatic sibling association for dbt is controlled by
siblings.enabled(ENABLE_SIBLING_HOOK, defaulttrue). It is a GMS setting. If you self-host, check it. On Cloud, contact DataHub Support. - If the datasets still aren't linked, add the link with
datahub dataset add_sibling.
Metadata looks wrong in the combined view
- Check the page URL. If it has
separate_siblings=true, remove it. The web UI shows siblings separately only when that parameter istrueor whenSHOW_SEPARATE_SIBLINGSis on server-wide. - Open each sibling on its own and check that the metadata exists on the source entity. If it's missing there, the cause is ingestion, not siblings.
- Lineage is merged across siblings. When an entity has siblings, GMS fetches each sibling's lineage and merges it in.
Two datasets both look primary
Query both with siblings { isPrimary }. To make one primary, run datahub dataset add_sibling --urn <the one to keep primary> --sibling-urns <the other>. The command marks --urn as primary and the others as not primary. If the dbt source manages these datasets, also check dbt_is_primary_sibling so the next run doesn't change it back.
Remove a sibling link
Use DatasetPatchBuilder.remove_sibling(sibling_urn). It removes only that URN and leaves other siblings in place.
Show siblings separately
showSeparateSiblings (SHOW_SEPARATE_SIBLINGS, default false) is a GMS setting. When on, it shows all siblings separately and gives no way to reach a combined view. Don't use it as a page-speed fix. On Cloud, contact DataHub Support about this setting.