Procedure

JSON

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend MDM Platform
Talend Real-Time Big Data Platform
Talend Data Services Platform
Talend Data Fabric
Talend Big Data
Talend Big Data Platform
Talend Data Integration
Talend Open Studio for ESB
Talend Data Management Platform
Talend Open Studio for MDM
Talend ESB
task
Data Governance > Third-party systems > File components (Integration) > JSON components
Design and Development > Third-party systems > File components (Integration) > JSON components
Data Quality and Preparation > Third-party systems > File components (Integration) > JSON components
EnrichPlatform
Talend Studio

Procedure

  1. In the Studio, open the Job used in Scenario 1: Extracting JSON data from a file using JSONPath without setting a loop node to display it in the design workspace.
  2. Double-click the tFileInputJSON component to open its Basic settings view.
  3. Select JsonPath from the Read By drop-down list.
  4. In the Loop Json query field, enter the JSONPath query expression between double quotation marks to specify the node on which the loop is based. In this example, it is "$.store.goods.book[*]".
  5. Click the [...] button next to Edit schema to open the schema editor.
    Select the five columns added previously and click the [x] button to remove all of them.
    Click the [+] button to add four columns, book_title, book_category, and book_author of String type, and book_price of Double type.
    Click OK to close the schema editor. In the pop-up dialog box, click Yes to propagate the schema to the subsequent component.
  6. In the Json query fields of the Mapping table, enter the JSONPath query expressions between double quotation marks to specify the nodes that hold the desired data. In this example, enter the JSONPath query expressions "title", "category", "author", and "price" relative to the four child nodes of the book node respectively.
  7. Press Ctrl+S to save the Job.
  8. Press F6 to execute the Job.
    As shown above, the book information is extracted from the source JSON data and displayed in a flat table on the console.