Struct Mask (StructMaskGenerator)
The Struct Mask generator applies selected generators to specific StructFields within a StructType in a Spark database.
For the Struct Mask generator, you provide a link object for each sub-generator configuration. The link object identifies the path expression and the sub-generator to run on the matching values for the expression.
The Struct Mask generator does not itself support consistency or differential privacy.
- The sub-generator type.
- The types of values to apply the sub-generator to.
- The
subGeneratorMetadata
object, which contains the generator configuration for the sub-generator.
{
"generatorId": "StructMaskGenerator",
"schema": "string",
"table": "string",
"column": "string",
"pathExpression": "string",
"subPresetId": "string",
"subGeneratorId": "string",
"metadata": {
"subPresetId": "string",
"subGeneratorId": "string",
"jsonFilterTypes": [ enum ],
"subGeneratorMetadata": {
//Metadata for the selected generator
}
"customValueProcessor": "string" //If custom value processor applied
"customSubGeneratorValueProcessor": "string" //If custom value processor applied to the sub-generator
}
In the following example replacement for the StructMask generator:
- The value at the path expression
$.address.city
is assigned the Address generator. The generator is configured to produce a city value. Consistency is disabled. - The value at the path expression
$.address.zip
is also assigned the Address generator. The generator is configured to produce a zip code value. Consistency is disabled.
{
"name": "value",
"schema": "",
"table": "simple_struct",
"links": [
{
"generatorId": "StructMaskGenerator",
"presetId": "StructMaskGenerator",
"schema": "",
"table": "simple_struct",
"column": "value",
"subPresetId": "AddressGenerator",
"subGeneratorId": "AddressGenerator",
"pathExpression": "$.address.city",
"metadata": {
"subPresetId": "AddressGenerator",
"subGeneratorId": "AddressGenerator",
"jsonFilterTypes": [
0
],
"subGeneratorMetadata": {
"addressType": "City",
"isConsistent": false
}
}
},
{
"generatorId": "StructMaskGenerator",
"presetId": "StructMaskGenerator",
"schema": "",
"table": "simple_struct",
"column": "value",
"subPresetId": "AddressGenerator",
"subGeneratorId": "AddressGenerator",
"pathExpression": "$.address.zip",
"metadata": {
"subPresetId": "AddressGenerator",
"subGeneratorId": "AddressGenerator",
"jsonFilterTypes": [
0
],
"subGeneratorMetadata": {
"addressType": "ZipCode",
"isConsistent": false
}
}
}
]
}
Last modified 1mo ago