Customize mapping
Published 03 November 2024
We're going to customize mapping to do the following:
A. Correct an incorrect classification
B. Add a custom masking
C. Supply custom datasets
These customizations will be done using the options file passed to the mapping.
This can also be done by editing the classification.json
file, but any changes will get overwritten next time classification is run.
A. Correct an incorrect classification
- {
- "tables": [
- {
- "schema": "dbo",
- "name": "Suppliers",
- "columns": [
- {
- "name": "ContactName",
- "type": "FamilyNames"
- }
- ]
- }
- ]
- }
This changes the classification of the ContactName
column in the dbo.Suppliers
table to "FamilyNames".
B. Add a custom masking
- {
- "tables": [
- {
- "schema": "dbo",
- "name": "Suppliers",
- "columns": [
- {
- "name": "ContactTitle",
- "dataset": "JobTitles"
- }
- ]
- }
- ]
- }
This configures the ContactTitle
column in the dbo.Suppliers
table to be masked as "JobTitles".
C. Supply custom datasets
- {
- "datasets": [
- {
- "name": "CompanyNames",
- "type": "List",
- "values": [ "Redgate Software", "Microsoft", "Google", "Amazon", "Apple", "Facebook", "Twitter" ]
- },
- {
- "name": "JobTitles",
- "type": "List",
- "values": [ "CEO", "CTO", "Director", "Engineer", "Developer", "Designer", "Analyst", "Consultant" ]
- }
- ]
- }
This supplies two custom datasets, "JobTitles" and "CompanyNames", that will be used in the masking step.
mapping-options.json
Putting the configurations for A-C above together into one options file produces the following:
- {
- "tables": [
- {
- "schema": "dbo",
- "name": "Suppliers",
- "columns": [
- {
- "name": "ContactName",
- "type": "FamilyNames"
- },
- {
- "name": "ContactTitle",
- "dataset": "JobTitles"
- }
- ]
- }
- ],
- "datasets": [
- {
- "name": "CompanyNames",
- "type": "List",
- "values": [ "Redgate Software", "Microsoft", "Google", "Amazon", "Apple", "Facebook", "Twitter" ]
- },
- {
- "name": "JobTitles",
- "type": "List",
- "values": [ "CEO", "CTO", "Director", "Engineer", "Developer", "Designer", "Analyst", "Consultant" ]
- }
- ]
- }
This should be saved into a file called mapping-options.json
, and will be passed into the mapping step when it is run.