Description
The Import from Avro JSON Schema option can be used to create Domains and Attributes by importing an Avro JSON Schema file into a selected Project Version within a Project. A Generator will be assigned to each Attribute, and a Receiver will be assigned to each Domain.
In This Article
- Sample Avro JSON Schema File
- How to Import an Avro JSON Schema File
- Additional Items Created During the Import
Sample Avro JSON Schema File
{ "type": "record", "name": "Event", "namespace": "com.detail.person", "doc": "Event is an object", "fields": [ { "name": "person", "doc": "Constains the person data.", "type": { "type": "record", "name": "PersonRecord", "fields": [ { "name": "firstName", "type": "string", "default": "", "doc": "first name of the person." }, { "name": "lastName", "type": "string", "default": "", "doc": "Last name of the person." }, { "name": "gender", "type": [ "null", { "type": "enum", "name": "actionTypes", "symbols": [ "Male", "Female" ] } ], "default": null, "doc": "A verb indicating what is the gender of the person." }, { "name": "relation", "type": [ "null", { "type": "record", "name": "RelationRecord", "fields": [ { "name": "siblings", "doc": "Contains the siblings count.", "type": "string", "default": "" }, { "name": "brothers", "doc": "Contains the brothers count.", "type": "string", "default": "" }, { "name": "sisters", "doc": "Contains the sister count.", "type": "string", "default": "" } ] } ], "default": null, "doc": "Contains the relationship of the person." } ] } }, { "name": "address", "type": [ "null", { "type": "record", "name": "AddressRecord", "fields": [ { "name": "address", "type": "string", "default": "", "doc": "contains the address information of the person" }, { "name": "city", "type": "string", "default": "", "doc": "city of the person" }, { "name": "state", "type": "string", "default": "", "doc": "State of the person." }, { "name": "zip", "type": "string", "default": "", "doc": "zip of the person." }, { "name": "country", "type": "string", "default": "", "doc": "country of the person." } ] } ] } ] }
How to Import an Avro JSON Schema File
- Select the Project and Project Version within the Project Dashboard.
- Expand the New Domain Menu and select Import from Avro JSON Schema.
- Click on the Choose File button to browse for and select the Avro JSON Schema file.
- Select an Output Format (e.g., JSON, Avro, Parquet). This determines what output format will be used when generating data.
- (Optional) Check the Enforce Type/Limit option.
- Click the Save button.
- Click OK to close the confirmation prompt.
- The request will be placed in the queue, and its status can be viewed within the Queue Status Pane.
- The Project Dashboard will appear as shown below once the import has been completed:
Additional Items Created During the Import
When importing an Avro JSON Schema file, a few additional items will be created automatically:
- Merge Domain - Merges the created Domains for test data generation. The Receiver assigned to this Domain will depend on what Output Option was selected during the import (JSON, Avro, or Parquet).
- Scenarios - A Scenario contains the instructions for generating data and will be created for each imported Domain.
- Scenario Chain Set - A Scenario Chain Set combines multiple Scenarios, which can be run as one command line in sequence for test data generation within a Command Prompt or Terminal window.
- Configuration File - The Config.xml file is used by the SegmentMergeReceiver (JSON, Avro, or Parquet) within the Merge Domain to inform the Receiver how to merge the data segments, segment files, and elements that were part of the imported Avro JSON Schema File.