Multi-export node
In Synthetic Data Generator, you can use a Multi-export node to save the synthetic data that you generated to several databases or files.
- Description
- Use the Multi-export node in a Synthetic Data Generator flow to save the generated synthetic data. For each table that is generated, you can pick the location to save the synthetic data to.
- If you use scripting, you can also save the synthetic data as files that are saved as project assets.
- Using the node
- You can connect a Multi-export node only to a Synthetic Data Generator flow that uses multi-table nodes. For more information, see Referential integrity and multi-table nodes.
- The Multi-export node is usually the last node in a Synthetic Data Generator flow. It takes the output from the Multi-gen node and writes the dataset in the format and location that you choose.
- Use only one Multi-export node to save the tabular data. You cannot use multiple nodes to export data to different locations.
- Mandatory or optional
- The Multi-export node is mandatory if you want to save the synthetic dataset that is generated.
Scripting with the Multi-export node
You can use scripting languages, like Python, to progammatically set properties for nodes.
Multi-export node properties
The following properties are specific to the Multi-export node. For information about common node properties, see Properties for flows and nodes.
| Property Name | Data type | Property description |
|---|---|---|
assets |
Structured property | A mapping of source table to target asset. Each entry includes the following: • key: Name of the source table in dot notation. For an example of the format, see Multi-import node.
• value: Asset details of the destination table, including: id, name, assettype, connpath, usersettings. For details, see Data structure for value property. |
Data structure for value property
- id
- The ID for the asset or connection
- name
- The name of the data asset or connection in the project
- assettype
- The type of asset (
DataAssetorConnection) - connpath
- When
Connectionis set forasset_type, the path to the table within the connection. - Depending on the database connection, the path includes the catalog and schema, for example
catalog_name/schema_name/table_name. - usersettings
- Escaped JSON string with interaction properties.
- For example,
{"interactionProperties":{"schema_name":"PERF","table_name":"GENERATED_SALES","write_mode":"insert","table_action":"append"}}
Example
The following script creates a Multi-export node and sets some properties for it.
stream = sdg.script.stream()
multiexport = stream.createAt("dataasset_export_multi_table", "ExportPlus", 388, 187)
multiexport.setPropertyValue("assets", "[['40039389-1b77-47d5-86d1-b37a5e6bf52e.PERF.CATEGORIES', ['40039389-1b77-47d5-86d1-b37a5e6bf52e', 'DB2 Premium', 'Connection', '/PERF/GENERATED_CATEGORIES', '{\"interactionProperties\":{\"schema_name\":\"PERF\",\"table_name\":\"GENERATED_CATEGORIES\", \"write_mode\":\"insert\", \"table_action\":\"append\"}}' ]], ['40039389-1b77-47d5-86d1-b37a5e6bf52e.PERF.CUSTOMERS', ['40039389-1b77-47d5-86d1-b37a5e6bf52e', 'DB2 Premium', 'Connection', '/PERF/GENERATED_CUSTOMERS', '{\"interactionProperties\":{\"schema_name\":\"PERF\",\"table_name\":\"GENERATED_CUSTOMERS\", \"write_mode\":\"insert\", \"table_action\":\"append\"}}' ]], ['40039389-1b77-47d5-86d1-b37a5e6bf52e.PERF.PRODUCTS', ['40039389-1b77-47d5-86d1-b37a5e6bf52e', 'DB2 Premium', 'Connection', '/PERF/GENERATED_PRODUCTS', '{\"interactionProperties\":{\"schema_name\":\"PERF\",\"table_name\":\"GENERATED_PRODUCTS\", \"write_mode\":\"insert\", \"table_action\":\"append\"}}' ]], ['40039389-1b77-47d5-86d1-b37a5e6bf52e.PERF.SALES', ['40039389-1b77-47d5-86d1-b37a5e6bf52e', 'DB2 Premium', 'Connection', '/PERF/GENERATED_SALES', '{\"interactionProperties\":{\"schema_name\":\"PERF\",\"table_name\":\"GENERATED_SALES\", \"write_mode\":\"insert\", \"table_action\":\"append\"}}' ]]]")
stream.link(generateplus, multiexport)
multiexport.run([])