Date Truncation (DateTruncationGenerator)

The Date Truncation generator truncates a date value or a timestamp to a specific part. For a date or a timestamp, you can truncate to the year, month, or day. For a timestamp, you can also truncate to the hour, minute, or second.

The Date Truncation generator does not support linking or consistency. You cannot configure differential privacy.

The metadata object is populated from the DateTruncationMetadata object. The generator-specific configuration includes the part of the datetime value to truncate to, and whether to change all dates that are more than 90 years before the generation date to a date exactly 90 years before the generation date.

{
  "schema": "string",
  "table": "string",
  "column": "string",
  "dataType": "string"  //MongoDB only
  "metadata": {
    "presetId": "string",
    "generatorId": "DateTruncationGenerator",
    "datePart": "enum",
    "isBirthDate": boolean,
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor applied.
  }
}

Example replacement

In the following example replacement for the Date Truncation generator, the values are truncated to the year. Date values that are older than 90 years before the generation date are not changed.

{
  "name": "event_date",
  "schema": "public",
  "table": "events",
  "links": [
    {
      "schema": "public",
      "table": "events",
      "column": "event_date",
      "metadata": {
        "presetId": "DateTruncationGenerator",
        "generatorId": "DateTruncationGenerator",
        "datePart": "Year",
        "isBirthDate": false
      }
    }
  ]
}

Last updated