Data Generator
The Data Generator processor serializes a record into a single string or byte array field using the specified data format.
You might use the Data Generator processor when you want to perform processing that is available only at a field level for an entire record. For example, the Encrypt and Decrypt Fields processor can encrypt data in one or more fields, but does not encrypt entire records. To encrypt entire records, you can use the Data Generator to serialize records into a single field, then use the Encrypt and Decrypt Fields processor to encrypt the field.
When you configure the Data Generator, you specify the target field and the output type to use, String or Byte Array. You also specify the data format for the serialized record and related properties.
Target field
When you use the Data Generator processor, you specify the target field for the serialized record.
When you specify a new field path, the processor creates the new field and writes the
serialized record to it. When you enter an existing field path, the processor replaces
the data in the existing field with the serialized record. When you enter
/ for the root field, the processor replaces the entire record with
a single field containing the serialized record.
Data formats
- Avro
- The stage writes records based on the Avro schema. You can use one of the following methods to specify the location of the Avro schema definition:
- Binary
- The stage writes binary data to a single field in the record.
- Delimited
- The target writes records as delimited data. When you use this data format, the root field must be list or list-map.
- JSON
- Generates a record for each JSON object. You can process JSON files that include multiple JSON objects or a single JSON array.
- Protobuf
- Generates a record for every protobuf message. By default, the source assumes messages contain multiple protobuf messages.
- SDC Record
- The target writes records in the SDC Record data format.
- Text
- The target writes data from a single text field to the target system. When you configure the stage, you select the field to use.
- XML
- Generates records based on a user-defined delimiter element. Use an XML element directly under the root element or define a simplified XPath expression. If you do not define a delimiter element, the source treats the XML file as a single record.
Configuring a Data Generator processor
About this task
Configure a Data Generator processor to serialize a record into a single field.