YAML configuration
YAML configuration
To execute a transformation user provides a YAML configuration file with properties of a specific transformation. UserConfig is the root object of this configuration file.
This object consists of default table configuration and a list of user-defined table config overrides and a set of global settings.
Example:
default_config:
mode: KEEP
target_ratio: 1.0
tables:
- table_name_with_schema: "public.orders"
mode: MASKING
target_ratio: 0.1
cycle_breaker_references: [ "public.orders" ]
insert_batch_size: 1000
use_working_directory: true
transformations:
- columns: [ "status" ]
params:
type: "categorical_generator"
categories:
value_source: PROVIDED
values:
"Shipped": 8
"Cancelled": 2
cycle_resolution_strategy: FAIL
schema_creation_mode: CREATE_IF_NOT_EXISTS
table_truncation_mode: TRUNCATE
global_seed: 42
safety_mode: "RELAXED"
Properties
-
default_config:Default configuration.
-
matchers: [#UserConfig_tables] -
tables: [#UserConfig_cycle_resolution_strategy] -
cycle_resolution_strategy:Cycle resolution strategy.
-
schema_creation_mode:Schema Creation Mode.
-
table_truncation_mode:Table truncation mode.
-
safety_mode:Safety Mode.
-
global_seed: A value used a seed for random number generators. Should be string in base64 encoded format. Basic alphabet (please refer to https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Base64.html) The result of generation must be the same each time the generation is being run with the same seed and workflow configuration. By default, this is set to an empty string, which corresponds to an empty byte array.
-
schemas: List of schemas to process. If not set or null, all available schemas will be processed.
-
metadata:Additional Metadata.
-
use_text_column_heuristics: Enables column and table name heuristics for selecting transformations for text fields. If enabled, theaddress_generator,person_generatorandfinance_generatorcan be chosen for text fields in GENERATION mode.
-
flags: [#UserConfig_scripts] -
scripts:Pre and post execution scripts.
-
variables:Config Variables.
Default configuration
Used in: default_config
Consists of the default table configuration parameters that are applied to all tables by default and a list of rules that are conditionally applied to the table.
Properties
-
mode:Transformation mode.
-
target_ratio: The relative size of each table of the output database with respect to the input. The number of rows of each output table will be computed by multiplying this parameter by the input table size. If not provided, this parameter will be target_ratio = 1, resulting on same size for input and output databases. Can be overridden bytarget_row_number
-
target_row_number: The absolute size of each table of the output database in rows. This parameter is applicable only for GENERATION mode. If not provided,target_ratiowill be used.
-
insert_batch_size: Indicates how many table rows are inserted to the database per each batch operation. The default value for this parameter is set at 1000 rows.
-
use_working_directory: Whether to use the configured local working directory to perform certain I/O operations more efficiently. In some cases, using working directory can speed up table insertion speed by several times. However, the more tables use the working directory, the more space is needed for it. Note that this setting is only effective when the working directory is configured globally (see Working directory properties).
-
locale: Default locale for specific transformations, such asperson_generatorandaddress_generator. This value can be overridden at the column transformation level.
Supported locales:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
in_memory_filter_threshold: Advanced performance tuning parameter. This parameter determines whether values the parent table are loaded into memory during filtering operations, depending on the table size. If the size of the table does not exceed this specified value, the values will be loaded into memory for filtering for child tables. The higher this threshold, the faster the filter can potentially run, provided that all values fit in memory. But if there is not enough memory, it may cause an error. The default value for this parameter is set at 100_000 rows.
-
parent_data_mode:Parent data mode.
-
checkpoint:Checkpoint.
-
fetch:Fetch configuration.
-
items: The rules used to select the appropriate transformation depending on the database metadata if one is not specified in the user’s configuration.
-
additional_items: Additional rules used to select the appropriate transformation depending on the database metadata if one is not specified in the user’s configuration. These rules take precedence over the rules initems: when a field matches both anadditional_itemsrule and anitemsrule, theadditional_itemsrule wins. Rules are evaluated in order and the first matching rule per field is applied. Use this to layer environment-specific overrides on top of the shareditemsrules without editing them. For example, anitemsrules by default inMASKINGmode mask every column, while anadditional_itemsrule tells the engine to put nulls in all nullable columns. The result of the execution is that all nullable columns will be nullified, while the rest of the columns will be masked. Example:
default_config:
mode: MASKING
additional_items:
- id: Nullify nullable
conditions:
- type: is_nullable
transformation:
type: null_generator
Cycle resolution strategy
Used in: cycle_resolution_strategy
Defines how to deal with cycles in table relations via foreign keys.
FAIL-
if this mode is selected,
cycle_breaker_referencesshould be provided in the configuration file. Otherwise, execution will fail if a circular reference is detected in the schema. DELETE_NOT_REQUIRED-
if this mode is selected, cyclic references will be resolved automatically by removing the last nullable reference that leads to the cycle. As a result, the cyclic reference columns will be masked to nulls.
DEFER_FOREIGN_KEY-
Oracle, MSSQL, MySQL and DB2 only. If this mode is selected, cyclic references will be automatically resolved by disabling foreign keys that lead to cycles during insertion. These references are re-enabled after the data has been inserted. As a result, the columns with cyclic references will be processed like any other keys in the schema. This strategy is only available when using
MASKINGorKEEPmode, and only with atarget_ratioof 1.
Example for a cycle breaker reference:
schema_creation_mode: CREATE_IF_NOT_EXISTS
cycle_resolution_strategy: FAIL
table_truncation_mode: TRUNCATE
safety_mode: "RELAXED"
default_config:
mode: GENERATION
target_ratio: 1.0
tables:
- table_name_with_schema: "public.employees"
cycle_breaker_references: ["public.employees"]
Where the employees table contains a cycle reference.
- Enum values
-
-
FAIL -
DELETE_NOT_REQUIRED -
DEFER_FOREIGN_KEY
-
Schema Creation Mode
Used in: schema_creation_mode
Defines the mode of schema creation.
| The schema creation feature only restores parts of the original schema required for Synthesized execution, such as tables, constraints, and indexes. Other database objects such as triggers, views, procedures, functions, and any vendor-specific properties are not supported. |
CREATE_IF_NOT_EXISTS-
if this mode is selected, DDL schema will be copied from the source database to the target one if it does not exist, existing schema will be used otherwise.
DO_NOT_CREATE-
if this mode is selected, the existing schema will be used without any validations. Please use this mode carefully: run-time errors may occur if the input and output schema do not match.
CREATE-
if this mode is selected, DDL schema will be copied from the source database to the target one. The target database should be empty.
DROP_AND_CREATE-
if this mode is selected, DDL schema will be copied from the source database to the target one. Existing schema in the target database will be dropped. Please use this mode carefully.
- Enum values
-
-
DO_NOT_CREATE -
CREATE -
CREATE_IF_NOT_EXISTS -
DROP_AND_CREATE
-
Table truncation mode
Used in: table_truncation_mode
Defines the mode of table truncation.
DO_NOT_TRUNCATE-
(default) if this mode is selected, tables in the target database won’t be truncated. An empty target database required.
TRUNCATE-
if this mode is selected, tables in the target database will be truncated.
IGNORE-
if this mode is selected, the status of the target database is ignored.
- Enum values
-
-
DO_NOT_TRUNCATE -
TRUNCATE -
IGNORE
-
Safety Mode
Used in: safety_mode
The mode of choosing transformations.
STRICT-
if this mode is selected and no matching transformation found, then no
passthrough,categorical_generator,null_generator,constant_generatortransformations will be chosen by default. If no matching transformation found, an error occurs. IfDEFER_FOREIGN_KEYcycle resolution strategy fails to re-enable a foreign key after transformation, an error occurs. RELAXED-
if this mode is selected and no matching transformation found, then the
passthroughtransformation will be applied forMASKINGmode, andnull_generatororcategorical_generatorforGENERATIONmode. Constant generatorsconstant_numeric,constant_string,constant_date,constant_booleanwill be chosen by default where the source column contains the same value in all rows. IfDEFER_FOREIGN_KEYcycle resolution strategy fails to re-enable a foreign key after transformation, a warning is shown in logs and transformation continues.
This property has no meaning for KEEP mode.
Default: STRICT.
- Enum values
-
-
STRICT -
RELAXED
-
Additional Metadata
Used in: metadata
Metadata that is not defined at the database level but must be taken into account when performing transformations.
Properties
-
tables: [#AdditionalMetadata_schemas] -
schemas: Schema mappings for transformations. Each mapping specifies an input schema to read from and an output schema to write to. Used for single-database transformations or cross-database schema renaming.
Pre and post execution scripts
Used in: scripts
SQL scripts to be executed on the target database before or after the transformation process.
Example:
scripts:
pre:
source: INLINE
script: |
ALTER TABLE public.transaction DISABLE TRIGGER ALL;
post:
source: FILE
path: post_script.sql
The post script will be executed after the transformation process in any case, including errors during the execution of the pre-script or the transformation process.
Properties
Config Variables
Used in: variables
A top-level block for YAML anchors (&name value), aliased elsewhere in the config as *name. Not read directly; declaring it here only keeps the block valid against the schema and safe to parse.
Transformation mode
Used in: mode
Defines table processing mode.
KEEP-
if this mode is selected, the original data will be copied as it is. When this mode is selected, the output size needs to be smaller than the input, i.e.
target_ratio <= 1. MASKING-
if this mode is selected, masking transformations will be applied to the original data. When this mode is selected, the output size needs to be smaller than the input, i.e.
target_ratio <= 1. GENERATION-
if this mode is selected, the synthesized engine will learn the original data and generate new synthetic data. For this mode, the output database can be bigger than the input, so
target_ratiocan be greater than 1.
Both KEEP and MASKING modes apply a transformation to original data. While KEEP uses passthrough as default transformation, while MASKING automatically assigns a privacy preserving masking transformation to all columns. See transformations list for more details. For all modes, the user can override default transformers.
|
- Enum values
-
-
MASKING -
GENERATION -
KEEP
-
Parent data mode
Used in: parent_data_mode
What part of parent data to consider for the child table processing. Default is ALL.
If defined on the table level, the parent data mode is applied to all suitable transformations of the table.
- Enum values
-
-
NEW -
OLD -
ALL
-
Checkpoint
Used in: checkpoint
Represents an entry point for handling repeated transformations.
Depending on mode property value, can be one of the following:
|
|
|
|
|
Fetch configuration
Used in: fetch
Configuration for how data is read from the source database per table. When not specified, defaults to streaming with a fetch size of 1000.
Depending on type property value, can be one of the following:
|
|
|
Pre and post execution script
Depending on source property value, can be one of the following:
|
|
|
Refresh Checkpoint
Represents a checkpoint for refreshing transformations. It is equivalent to full re-execution of the table transformation. CAUTION: This checkpoint will always start from the beginning of the table, ignoring any previously processed data. This may lead to data duplication or constraints violation in the target database if the transformation has already been partially executed.
Properties
-
mode = refresh
Ignore Table Checkpoint
Represents a checkpoint for ignoring table on hitting checkpoint in any other table.
NOTE: This checkpoint will skip the table transformation, which may lead to missing the data in the target database for this table. If you want to ensure that the table in the output database is up to date, use the refresh or incremental checkpoint instead.
Properties
-
mode = ignore_table
Streaming fetch configuration
Uses JDBC server-side cursors (fetchLazy()). This is the default and provides the lowest memory overhead, but does not survive connection drops — if the connection is lost mid-read, the entire read fails and must restart from the beginning.
Properties
-
type = streaming
Chunking fetch configuration
Uses keyset pagination (on primary key or unique key) to read data in independent stateless chunks. Each chunk is a separate query bounded by a checkpoint, so the read can resume from the last checkpoint after a connection drop. Not all dialects support chunking; specifying chunking for an unsupported dialect is a configuration error.
Properties
-
type = chunking