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.

The generator does not itself support consistency or differential privacy.

The metadata object is populated from the CsvMaskMetadata object, and includes:

  • pathExpression, which is the index to apply the sub-generator to.

  • The delimiter used to separate the CSV values.

  • Whether to apply that generator to indexes that are not assigned a generator.

  • The subGeneratorMetadata object, which identifies and configures the sub-generator.

Here is the basic structure of a link object for a CSV Mask sub-generator.

{
  "schema": "string",
  "table": "string",
  "column": "string",
  "metadata": {
    "generatorId": "CsvMaskGenerator",
    "presetId": "CsvMaskGenerator",
    "customValueProcessor": "string", //If custom value processor applied to the generator
    "pathExpression": "string",
    "delimiter": "string",
    "isDefaultGenerator": boolean,
    "subGeneratorMetadata": {
      "presetId": "string",
      "generatorId": "string",
       //Metadata for the selected sub-generator
      "customValueProcessor": "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": [
    {
      "schema": "public",
      "table": "customers",
      "column": "location"
      "metadata": {
        "generatorId": "CsvMaskGenerator",
        "presetId": "CsvMaskGenerator",
        "delimiter": ",",
        "pathExpression": "0",
        "isDefaultGenerator": false,
        "subGeneratorMetadata": {
          "presetId": "AddressGenerator",
          "generatorId": "AddressGenerator",
          "addressType": "City",
          "isConsistent": false
        }
      }
    },
    {
      "table": "customers",
      "schema": "public",
      "column": "location",
      "metadata": {
        "generatorId": "CsvMaskGenerator",
        "presetId": "CsvMaskGenerator",
        "delimiter": ",",
        "pathExpression": "1",
        "isDefaultGenerator": false,
        "subGeneratorMetadata": {
          "presetId": "CompanyNameGenerator",
          "generatorId": "CompanyNameGenerator",
          "isConsistent": false
        }
      }
    }
  ]
}

Last updated