Skip to main content Skip to complementary content

Creating hierarchical structures and maps

Procedure

  1. Create a text file named sample.json with the following content:
    {
      "doc": "Sample schema to help you get started.",
      "fields": [
        {
          "doc": "The int type is a 32-bit signed integer.",
          "name": "my_field1",
          "type": "int"
        },
        {
          "doc": "The double type is a double precision (64-bit) IEEE 754 floating-point number.",
          "name": "my_field2",
          "type": "int"
        },
        {
          "doc": "The string is a unicode character sequence.",
          "name": "my_field3",
          "type": "string"
        }
      ],
      "name": "AvroSample",
      "namespace": "talend",
      "type": "record"
    }
  2. From the repository tree view, right-click Metadata > Hierarchical Mapper > Structure and select New > Folder from the contextual menu.
  3. In the New Folder dialog box, enter Avro in the Folder name field and click Finish.
  4. Right-click Metadata > Hierarchical Mapper > Structure and select New > Structure from the contextual menu.
  5. In the New Structure dialog box, select Import a structure definition… > Avro Schema > Local file. Browse to the sample.json file you just created and import the schema into the Avro folder.
  6. Right-click Metadata > Hierarchical Mapper > Maps and select New > Folder from the contextual menu.
  7. In the New Folder dialog box, enter Avro in the Name field and click Finish.
  8. Right-click Metadata > Hierarchical Mapper > Maps and select New > Map from the contextual menu.
  9. In the New Map dialog box, select Standard Map and create two Maps inside the Avro folder using the structure created in the previous steps.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!