Area: Product
Sub-Area: Data Governance
Applies to: OSS + Cloud
Issue
You want DataHub to find the columns that hold personally identifiable information (PII), label them, and limit who can see them.
You Might Be Asking
- Can DataHub automatically detect PII columns?
- How do I classify sensitive data columns?
- What PII detection patterns are supported?
- Can a DataHub policy hide PII columns from some users?
Cause
DataHub has no pii_detection setting, under profiling or anywhere else. Recipes with unknown keys fail validation.
Automatic detection is the classification feature. You set it with a classification block in the source config. Classification adds glossary terms to columns. It does not add tags.
acryl-datahub 1.6.0.10 and later do not include the built-in datahub classifier. On these versions, a recipe with classification.enabled: true and no custom classifier fails at startup.
DataHub policies only grant privileges on metadata in DataHub. A policy cannot deny access or hide a column. It does not control who can query the data in your source platform.
Solution
To detect PII columns during ingestion:
- To auto-detect columns, add a
classificationblock to the source config and name your own registered classifier underclassifiers. The Classification guide shows how. - To keep the built-in classifier, pin acryl-datahub 1.6.0.9. It is the last release that includes it.
- To label columns by name, use the
pattern_add_dataset_schema_tagstransformer (tag_pattern) for tags. Use thepattern_add_dataset_schema_termstransformer (term_pattern) for glossary terms. Each transformer accepts only its own key.
To tag a column by hand or with code:
- In the UI, add the tag to the column on the dataset page.
- With GraphQL, use
addTagoraddTagswithsubResourceType: DATASET_FIELDandsubResourceset to the column path. - With Python, create
builder = DatasetPatchBuilder(urn)and callbuilder.for_field("<column>").add_tag(TagAssociationClass(tag=...)). Then emit each MCP frombuilder.build(). - Do not emit a new
EditableSchemaMetadataClassto add column tags. It replaces the stored aspect and removes the descriptions, tags and terms on every column it does not include.
To limit access to PII:
- Enforce column-level security, such as masking, in the source platform.
- Use DataHub policies only to grant who can view or edit metadata in DataHub. A policy that names a PII tag does not hide any column.
The full examples are in Add Tags to a Column of a Dataset.
Related Documentation
- Classification
- Pattern Add Dataset Schema Field globalTags
- Pattern Add Dataset Schema Field glossaryTerms
- Add Tags to a Column of a Dataset
- Policies
Tags: pii, sensitive-data, data-classification, column-security, privacy, gdpr, compliance, data-governance, column-tags