Area: Ingestion Issues
Sub-Area: CSV Enricher Configuration
Applies to: OSS + Cloud
Issue
You use the csv-enricher source to give the same asset several ownership types, with one CSV row for each type. After ingestion on an older CLI or executor version, only one ownership type shows on the asset.
You Might Be Asking
- Why is only one ownership type applied when I have several rows in my CSV?
- How can I assign the same owner with more than one ownership type using csv-enricher?
- Do I need separate csv-enricher runs for each ownership type?
- Is there another way to add several ownership types in bulk?
Cause
Older versions of the CLI or executor that runs the recipe did not apply these rows separately, so only one ownership type persisted for the asset.
In current versions, PATCH mode reads the asset's current ownership and adds only the owners that are not already present. It counts an owner as present only when the owner, the type and the typeUrn all match. A row with the same owner and a different typeUrn is added. It does not overwrite the whole Ownership aspect with each row.
The fix is in the CLI or executor that runs the recipe, so that version is the one that matters:
- OSS:
acryl-datahub1.6.0 and later. - Cloud: v0.3.17.7 and later 0.3.17 patches, and v1.1.0-cloud and later. v1.0.x-cloud does not have the fix.
Solution
-
Upgrade the CLI or executor that runs the recipe. Use the latest release. After you upgrade, your existing CSV format works, with one row for each owner and ownership type pair.
-
Check the ownership columns. Use the columns
resource,owners,ownership_typeandownership_type_urn. If you setownership_type_urnandownership_typeis notCUSTOM, csv-enricher adds the warning "Ownership type URN is set but ownership type is not CUSTOM. Setting ownership_type to CUSTOM." to the ingestion report, usesCUSTOM, and the run continues. To avoid the warning, setownership_typetoCUSTOMon rows that have anownership_type_urn. -
Keep
write_semanticsatPATCH.PATCHis the default, and the other value isOVERRIDE. The setting applies to all metadata for the entity, not one aspect. -
Separate runs per ownership type work on a fixed version. Each
PATCHrun reads the existing ownership and adds owners that are not already there. -
Alternative: GraphQL. Call
addOwners(input: AddOwnersInput!)withownersandresourceUrn. Each owner inownerstakesownerUrn,ownerEntityType(CORP_USERorCORP_GROUP) andownershipTypeUrn. You can pass several owners with differentownershipTypeUrnvalues in one call. For many assets, usebatchAddOwners, which takesowners,resourcesandownershipTypeUrn. The mutation fails if an owner does not exist, with "Failed to change ownership for resource(s). Owner with urn ... does not exist."
On Cloud, if you can't tell which executor version runs your recipe, contact DataHub Support.