Scenario: Writing a JSON structured file - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This is a 2 component scenario in which a tRowGenerator component generates random data which a tFileOutputJSON component then writes to a JSON structured output file.

  1. Drop a tRowGenerator and a tFileOutputJSON component onto the workspace from the Palette.

  2. Link the components using a Row > Main connection.

  3. Double click tRowGenerator to define its Basic Settings properties in the Component view.

  4. Click [...] next to Edit Schema to display the corresponding dialog box and define the schema.

  5. Click [+] to add the number of columns desired.

  6. Under Columns type in the column names.

  7. Under Type, select the data type from the list.

  8. Click OK to close the dialog box.

  9. Click [+] next to RowGenerator Editor to open the corresponding dialog box.

  10. Under Functions, select pre-defined functions for the columns, if required, or select [...] to set customized function parameters in the Function parameters tab.

  11. Enter the number of rows to be generated in the corresponding field.

  12. Click OK to close the dialog box.

  13. Click tFileOutputJSON to set its Basic Settings properties in the Component view.

  14. Click [...] to browse to where you want the output JSON file to be generated and enter the file name.

  15. Enter a name for the data block to be generated in the corresponding field, between double quotation marks.

  16. Select Built-In as the Schema type.

  17. Click Sync Columns to retrieve the schema from the preceding component.

  18. Press F6 to run the Job.

The data from the input schema is written in a JSON structured data block in the output file.