Links
Comment on page

CSV Mask (CsvMaskGenerator)

The CSV Mask generator allows to assign specific generators to specific indexes. You can also use the generator that is assigned to a specific index as the default. This applies the generator to every index that does not have an assigned generator.
For the CSV Mask generator, there is a link object for each index to assign a generator to.
pathExpression contains the index, and subGeneratorId identifies the generator to assign to that index.
The CSV Mask generator does not itself support consistency or differential privacy.
The metadata object is populated from the CsvMaskMetadata object, which includes:
  • The delimiter used to separate the CSV values.
  • The sub-generator type to apply to the index specified in pathExpression.
  • Whether to apply that generator to indexes that are not assigned a generator.
  • The subGeneratorMetadata object, which contains the generator configuration for the sub-generator.
Here is the basic structure of a link object for a CSV Mask sub-generator.
{
"generatorId": "CsvMaskGenerator",
"presetid": "CsvMaskGenerator",
"schema": "string",
"table": "string",
"column": "string",
"subGeneratorId": "string",
"pathExpression": "string",
"metadata": {
"delimiter": "string",
"subPresetId": "string",
"subGeneratorId": "string",
"isDefaultGenerator": boolean,
"subGeneratorMetadata": {
//Metadata for the selected generator
}
}
"customValueProcessor": "string", //If custom value processor applied to the generator
"customSubGeneratorValueProcessor": "string" //If custom value processor applied to the sub-generator
}

Example replacement

This example replacement for the CSV Mask generator assigns generators to index 0 and index 1 of the column value. The delimiter is a comma.
For index 0, the Address generator is assigned, with an address type of City and consistency disabled.
For index 1, the Company Name generator is assigned, with consistency disabled.
Neither sub-generator is assigned as the default generator for other indexes.
{
"name": "word",
"schema": "public",
"table": "customers",
"links": [
{
"generatorId": "CsvMaskGenerator",
"presetId": "CsvMaskGenerator",
"schema": "public",
"table": "customers",
"column": "location",
"subPresetId": "AddressGenerator",
"subGeneratorId": "AddressGenerator",
"pathExpression": "0",
"metadata": {
"delimiter": ",",
"subPresetId": "AddressGenerator",
"subGeneratorId": "AddressGenerator",
"isDefaultGenerator": false,
"subGeneratorMetadata": {
"addressType": "City",
"isConsistent": false
}
}
},
{
"generatorId": "CsvMaskGenerator",
"presetId": "CsvMaskGenerator",
"table": "customers",
"schema": "public",
"column": "location",
"subPresetId": "CompanyNameGenerator",
"subGeneratorId": "CompanyNameGenerator",
"pathExpression": "1",
"metadata": {
"delimiter": ",",
"subPresetId": "CompanyNameGenerator",
"subGeneratorId": "CompanyNameGenerator",
"isDefaultGenerator": false,
"subGeneratorMetadata": {
"isConsistent": false
}
}
}
]
}
Last modified 3mo ago