tExtractJSONFields - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

tExtractJSONFields extracts the desired data from incoming JSON fields based on the XPath or JSONPath query.

Purpose

tExtractJSONFields extracts the data from JSON fields stored in a file, a database table, etc., based on the XPath or JSONPath query.

If you have subscribed to one of the Talend solutions with Big Data, this component is available in the following types of Jobs:

tExtractJSONFields properties

Component family

Processing/Fields

 

Basic settings

Property type

Either Built-In or Repository.

 

 

Built-In: No property data stored centrally.

 

 

Repository: Select the repository file where the properties are stored.

 

Schema and Edit Schema

A schema is a row description. It defines the number of fields (columns) to be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-In: You create and store the schema locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs. Related topic: see Talend Studio User Guide.

 

Read by

Select a way of extracting the JSON data in the file.

  • Xpath: Extracts the JSON data based on the XPath query.

  • JsonPath: Extracts the JSON data based on the JSONPath query. Note that it is recommended to read the data by JSONPath in order to gain better performance.

 

JSON field

List of the JSON fields to be extracted.

 

Loop Jasonpath query

Enter the path pointing to the node within the JSON field, on which the loop is based.

Note if you have selected Xpath from the Read by drop-down list, the Loop Xpath query field is displayed instead.

 

Mapping

Complete this table to map the columns defined in the schema to the corresponding JSON nodes.

  • Column: The Column cells are automatically filled with the defined schema column names.

  • Json query/JSONPath query: Specify the JSONPath node that holds the desired data. For more information about JSONPath expressions, see http://goessner.net/articles/JsonPath/.

    This column is available only when JsonPath is selected from the Read By list.

  • XPath query: Specify the XPath node that holds the desired data.

    This column is available only when Xpath is selected from the Read By list.

  • Get Nodes: Select this check box to extract the JSON data of all the nodes or select the check box next to a specific node to extract the data of that node.

    This column is available only when Xpath is selected from the Read By list.

  • Is Array: select this check box when the JSON field to be extracted is an array instead of an object.

    This column is available only when Xpath is selected from the Read By list.

 

Die on error

Select this check box to stop the execution of the Job when an error occurs.

Clear the check box to skip any rows on error and complete the process for error-free rows. When errors are skipped, you can collect the rows on error using a Row > Reject link.

Advanced settings

Encoding

Select the encoding from the list or select Custom and define it manually. This field is compulsory for database data handling.

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a Job level as well as at each component level.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

NB_LINE: the number of rows read by an input component or transferred to an output component. This is an After variable and it returns an integer.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component is an intermediate component. It needs an input and an output components.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

Due to license incompatibility, one or more JARs required to use this component are not provided. You can install the missing JARs for this particular component by clicking the Install button on the Component tab view. You can also find out and add all missing JARs easily on the Modules tab in the Integration perspective of your studio. For details, see https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products or the section describing how to configure the Studio in the Talend Installation Guide.

Scenario 1: Retrieving error messages while extracting data from JSON fields

In this scenario, tWriteJSONField wraps the incoming data into JSON fields, data of which is then extracted by tExtractJSONFields. Meanwhile, the error messages generated due to extraction failure, which include the concerned JSON fields and errors, are retrieved via a Row > Reject link.

Linking the components

  1. Drop the following components from the Palette onto the design workspace: tFixedFlowInput, tWriteJSONField, tExtractJSONFields, and tLogRow (X2). The two tLogRow components are renamed as data_extracted and reject_info.

  2. Link tFixedFlowInput and tWriteJSONField using a Row > Main connection.

  3. Link tWriteJSONField and tExtractJSONFields using a Row > Main connection.

  4. Link tExtractJSONFields and data_extracted using a Row > Main connection.

  5. Link tExtractJSONFields and reject_info using a Row > Reject connection.

Configuring the components

Setting up the tFixedFlowInput

  1. Double-click tFixedFlowInput to display its Basic settings view.

  2. Click Edit schema to open the schema editor.

    Click the [+] button to add three columns, namely firstname, lastname and dept, with the type of string.

    Click OK to close the editor.

  3. Select Use Inline Content and enter the data below in the Content box:

    Andrew;Wallace;Doc
    John;Smith;R&D
    Christian;Dior;Sales

Setting up the tWriteJSONField

  1. Click tWriteJSONField to display its Basic settings view.

  2. Click Configure JSON Tree to open the XML tree editor.

    The schema of tFixedFlowInput appears in the Linker source panel.

  3. In the Linker target panel, click the default rootTag and type in staff, which is the root node of the JSON field to be generated.

  4. Right-click staff and select Add Sub-element from the context menu.

  5. In the pop-up box, enter the sub-node name, namely firstname.

    Repeat the steps to add two more sub-nodes, namely lastname and dept.

  6. Right-click firstname and select Set As Loop Element from the context menu.

  7. Drop firstname from the Linker source panel to its counterpart in the Linker target panel.

    In the pop-up dialog box, select Add linker to target node.

    Click OK to close the dialog box.

  8. Repeat the steps to link the two other items.

    Click OK to close the XML tree editor.

  9. Click Edit schema to open the schema editor.

  10. Click the [+] button in the right panel to add one column, namely staff, which will hold the JSON data generated.

    Click OK to close the editor.

Setting up the tExtractJSONFields

  1. Double-click tExtractJSONFields to display its Basic settings view.

  2. Click Edit schema to open the schema editor.

  3. Click the [+] button in the right panel to add three columns, namely firstname, lastname and dept, which will hold the data of their counterpart nodes in the JSON field staff.

    Click OK to close the editor.

  4. In the pop-up Propagate box, click Yes to propagate the schema to the subsequent components.

  5. In the Loop XPath query field, enter "/staff", which is the root node of the JSON data.

  6. In the Mapping area, type in the node name of the JSON data under the XPath query part. The data of those nodes will be extracted and passed to their counterpart columns defined in the output schema.

  7. Specifically, define the XPath query "firstname" for the column firstname, "lastname" for the column lastname, and "" for the column dept. Note that "" is not a valid XPath query and will lead to execution errors.

Setting up the tLogRow components

  1. Double-click data_extracted to display its Basic settings view.

  2. Select Table (print values in cells of a table) for a better display of the results.

  3. Perform the same setup on the other tLogRow component, namely reject_info.

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Click F6 to execute the Job.

    As shown above, the reject row offers such details as the data extracted, the JSON fields whose data is not extracted and the cause of the extraction failure.

Scenario 2: Collecting data from your favorite online social network

In this scenario, tFileInputJSON retrieves the friends node from a JSON file that contains the data of a Facebook user and tExtractJSONFields extracts the data from the friends node for flat data output.

Linking the components

  1. Drop the following components from the Palette onto the design workspace: tFileInputJSON, tExtractJSONFields and tLogRow.

  2. Link tFileInputJSON and tExtractJSONFields using a Row > Main connection.

  3. Link tExtractJSONFields and tLogRow using a Row > Main connection.

Configuring the components

  1. Double-click tFileInputJSON to display its Basic settings view.

  2. Click Edit schema to open the schema editor.

    Click the [+] button to add one column, namely friends, of the String type.

    Click OK to close the editor.

  3. Click the [...] button to browse for the JSON file, facebook.json in this case:

    { "user": { "id": "9999912398",
                "name": "Kelly Clarkson",
                "friends": [
                     { "name": "Tom Cruise",
                       "id": "55555555555555",
                       "likes": {
                           "data": [
                                { "category": "Movie",
                                  "name": "The Shawshank Redemption",
                                  "id": "103636093053996",
                                  "created_time": "2012-11-20T15:52:07+0000"
                                },
                                { "category": "Community",
                                  "name": "Positiveretribution",
                                  "id": "471389562899413",
                                  "created_time": "2012-12-16T21:13:26+0000"
                                }
                                    ]
                                }
                     },
                     { "name": "Tom Hanks",
                       "id": "88888888888888"
                       "likes": {
                            "data": [
                                { "category": "Journalist",
                                  "name": "Janelle Wang",
                                  "id": "136009823148851",
                                  "created_time": "2013-01-01T08:22:17+0000"
                                },
                                { "category": "Tv show",
                                  "name": "Now With Alex Wagner",
                                  "id": "305948749433410",
                                  "created_time": "2012-11-20T06:14:10+0000"
                                }
                                ]
                               }
                      }
                            ]
              }
    }
    
  4. Clear the Read by XPath check box.

    In the Mapping table, enter the JSONPath query "$.user.friends[*]" next to the friends column, retrieving the entire friends node from the source file.

  5. Double-click tExtractJSONFields to display its Basic settings view.

  6. Click Edit schema to open the schema editor.

  7. Click the [+] button in the right panel to add five columns, namely id, name, like_id, like_name and like_category, which will hold the data of relevant nodes in the JSON field friends.

    Click OK to close the editor.

  8. In the pop-up Propagate box, click Yes to propagate the schema to the subsequent components.

  9. In the Loop XPath query field, enter "/likes/data".

  10. In the Mapping area, type in the queries of the JSON nodes in the XPath query column. The data of those nodes will be extracted and passed to their counterpart columns defined in the output schema.

  11. Specifically, define the XPath query "../../id" (querying the "/friends/id" node) for the column id, "../../name" (querying the "/friends/name" node) for the column name, "id" for the column like_id, "name" for the column like_name, and "category" for the column like_category.

  12. Double-click tLogRow to display its Basic settings view.

  13. Select Table (print values in cells of a table) for a better display of the results.

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Click F6 to execute the Job.

    As shown above, the friends data of the Facebook user Kelly Clarkson is extracted correctly.

tExtractJSONFields in Talend Map/Reduce Jobs

Warning

The information in this section is only for users that have subscribed to one of the Talend solutions with Big Data and is not applicable to Talend Open Studio for Big Data users.

In a Talend Map/Reduce Job, tExtractJSONFields, as well as the other Map/Reduce components preceding it, generates native Map/Reduce code. This section presents the specific properties of tExtractJSONFields when it is used in that situation. For further information about a Talend Map/Reduce Job, see Talend Big Data Getting Started Guide.

Component family

Processing/Fields

 

Basic settings

Property type

Either Built-In or Repository.

 

 

Built-In: No property data stored centrally.

 

 

Repository: Select the repository file where the properties are stored.

 

Schema and Edit Schema

A schema is a row description. It defines the number of fields (columns) to be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-In: You create and store the schema locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs. Related topic: see Talend Studio User Guide.

 

Read by

Select a way of extracting the JSON data in the file.

  • Xpath: Extracts the JSON data based on the XPath query.

  • JsonPath: Extracts the JSON data based on the JSONPath query. Note that it is recommended to read the data by JSONPath in order to gain better performance.

 

JSON field

List of the JSON fields to be extracted.

 

Loop Jasonpath query

Enter the path pointing to the node within the JSON field, on which the loop is based.

Note if you have selected Xpath from the Read by drop-down list, the Loop Xpath query field is displayed instead.

 

Mapping

Complete this table to map the columns defined in the schema to the corresponding JSON nodes.

  • Column: The Column cells are automatically filled with the defined schema column names.

  • Json query/JSONPath query: Specify the JSONPath node that holds the desired data. For more information about JSONPath expressions, see http://goessner.net/articles/JsonPath/.

    This column is available only when JsonPath is selected from the Read By list.

  • XPath query: Specify the XPath node that holds the desired data.

    This column is available only when Xpath is selected from the Read By list.

  • Get Nodes: Select this check box to extract the JSON data of all the nodes or select the check box next to a specific node to extract the data of that node.

    This column is available only when Xpath is selected from the Read By list.

  • Is Array: select this check box when the JSON field to be extracted is an array instead of an object.

    This column is available only when Xpath is selected from the Read By list.

 

Die on error

Select this check box to stop the execution of the Job when an error occurs.

Clear the check box to skip any rows on error and complete the process for error-free rows. When errors are skipped, you can collect the rows on error using a Row > Reject link.

Advanced settings

Encoding

Select the encoding from the list or select Custom and define it manually. This field is compulsory for database data handling.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

NB_LINE: the number of rows read by an input component or transferred to an output component. This is an After variable and it returns an integer.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage in Map/Reduce Jobs

In a Talend Map/Reduce Job, this component is used as an intermediate step and other components used along with it must be Map/Reduce components, too. They generate native Map/Reduce code that can be executed directly in Hadoop.

You need to use the Hadoop Configuration tab in the Run view to define the connection to a given Hadoop distribution for the whole Job.

For further information about a Talend Map/Reduce Job, see the sections describing how to create, convert and configure a Talend Map/Reduce Job of the Talend Big Data Getting Started Guide.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs, and non Map/Reduce Jobs.

Related scenarios

No scenario is available for the Map/Reduce version of this component yet.

tExtractJSONFields properties in Spark Batch Jobs

Component family

Processing/Fields

 

Basic settings

Property type

Either Built-In or Repository.

 

 

Built-In: No property data stored centrally.

 

 

Repository: Select the repository file where the properties are stored.

 

Schema and Edit Schema

A schema is a row description. It defines the number of fields (columns) to be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-In: You create and store the schema locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs. Related topic: see Talend Studio User Guide.

 

Read by

Select a way of extracting the JSON data in the file.

  • Xpath: Extracts the JSON data based on the XPath query.

  • JsonPath: Extracts the JSON data based on the JSONPath query. Note that it is recommended to read the data by JSONPath in order to gain better performance.

 

JSON field

List of the JSON fields to be extracted.

 

Loop Jasonpath query

Enter the path pointing to the node within the JSON field, on which the loop is based.

Note if you have selected Xpath from the Read by drop-down list, the Loop Xpath query field is displayed instead.

 

Mapping

Complete this table to map the columns defined in the schema to the corresponding JSON nodes.

  • Column: The Column cells are automatically filled with the defined schema column names.

  • Json query/JSONPath query: Specify the JSONPath node that holds the desired data. For more information about JSONPath expressions, see http://goessner.net/articles/JsonPath/.

    This column is available only when JsonPath is selected from the Read By list.

  • XPath query: Specify the XPath node that holds the desired data.

    This column is available only when Xpath is selected from the Read By list.

  • Get Nodes: Select this check box to extract the JSON data of all the nodes or select the check box next to a specific node to extract the data of that node.

    This column is available only when Xpath is selected from the Read By list.

  • Is Array: select this check box when the JSON field to be extracted is an array instead of an object.

    This column is available only when Xpath is selected from the Read By list.

 

Die on error

Select this check box to stop the execution of the Job when an error occurs.

Advanced settings

Encoding

Select the encoding from the list or select Custom and define it manually. This field is compulsory for database data handling.

Usage in Spark Batch Jobs

In a Talend Spark Batch Job, this component is used as an intermediate step and other components used along with it must be Spark Batch components, too. They generate native Spark Batch code that can be executed directly in a Spark cluster.

This component, along with the Spark Batch component Palette it belongs to, appears only when you are creating a Spark Batch Job.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs.

Spark Connection

You need to use the Spark Configuration tab in the Run view to define the connection to a given Spark cluster for the whole Job. In addition, since the Job expects its dependent jar files for execution, one and only one file system related component from the Storage family is required in the same Job so that Spark can use this component to connect to the file system to which the jar files dependent on the Job are transferred:

This connection is effective on a per-Job basis.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Related scenarios

No scenario is available for the Spark Batch version of this component yet.

tExtractJSONFields properties in Spark Streaming Jobs

Warning

The streaming version of this component is available in the Palette of the studio on the condition that you have subscribed to Talend Real-time Big Data Platform or Talend Data Fabric.

Component family

Processing/Fields

 

Basic settings

Property type

Either Built-In or Repository.

 

 

Built-In: No property data stored centrally.

 

 

Repository: Select the repository file where the properties are stored.

 

Schema and Edit Schema

A schema is a row description. It defines the number of fields (columns) to be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-In: You create and store the schema locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs. Related topic: see Talend Studio User Guide.

 

Read by

Select a way of extracting the JSON data in the file.

  • Xpath: Extracts the JSON data based on the XPath query.

  • JsonPath: Extracts the JSON data based on the JSONPath query. Note that it is recommended to read the data by JSONPath in order to gain better performance.

 

JSON field

List of the JSON fields to be extracted.

 

Loop Jasonpath query

Enter the path pointing to the node within the JSON field, on which the loop is based.

Note if you have selected Xpath from the Read by drop-down list, the Loop Xpath query field is displayed instead.

 

Mapping

Complete this table to map the columns defined in the schema to the corresponding JSON nodes.

  • Column: The Column cells are automatically filled with the defined schema column names.

  • Json query/JSONPath query: Specify the JSONPath node that holds the desired data. For more information about JSONPath expressions, see http://goessner.net/articles/JsonPath/.

    This column is available only when JsonPath is selected from the Read By list.

  • XPath query: Specify the XPath node that holds the desired data.

    This column is available only when Xpath is selected from the Read By list.

  • Get Nodes: Select this check box to extract the JSON data of all the nodes or select the check box next to a specific node to extract the data of that node.

    This column is available only when Xpath is selected from the Read By list.

  • Is Array: select this check box when the JSON field to be extracted is an array instead of an object.

    This column is available only when Xpath is selected from the Read By list.

 

Die on error

Select this check box to stop the execution of the Job when an error occurs.

Advanced settings

Encoding

Select the encoding from the list or select Custom and define it manually. This field is compulsory for database data handling.

Usage in Spark Streaming Jobs

In a Talend Spark Streaming Job, this component is used as an intermediate step and other components used along with it must be Spark Streaming components, too. They generate native Spark Streaming code that can be executed directly in a Spark cluster.

This component, along with the Spark Streaming component Palette it belongs to, appears only when you are creating a Spark Streaming Job.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs.

Spark Connection

You need to use the Spark Configuration tab in the Run view to define the connection to a given Spark cluster for the whole Job. In addition, since the Job expects its dependent jar files for execution, one and only one file system related component from the Storage family is required in the same Job so that Spark can use this component to connect to the file system to which the jar files dependent on the Job are transferred:

This connection is effective on a per-Job basis.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Related scenarios

For a related scenario, see Analyzing a Twitter flow in near real-time.

tExtractJSONFields in Talend Storm Jobs

Warning

The information in this section is only for users that have subscribed to one of the Talend solutions with Big Data and is not applicable to Talend Open Studio for Big Data users.

In a Talend Storm Job, tExtractJSONFields, as well as the other Storm components preceding it, generates native Storm code. This section presents the specific properties of tExtractJSONFields when it is used in that situation. For further information about a Talend Storm Job, see Talend Big Data Getting Started Guide.

Component family

Processing/Fields

 

Basic settings

Property type

Either Built-In or Repository.

 

 

Built-In: No property data stored centrally.

 

 

Repository: Select the repository file where the properties are stored.

 

Schema and Edit Schema

A schema is a row description. It defines the number of fields (columns) to be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-In: You create and store the schema locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs. Related topic: see Talend Studio User Guide.

 

JSON field

List of the JSON fields to be extracted.

 

Loop XPath query

Node within the JSON field, on which the loop is based.

 

Mapping

Column: schema defined to hold the data extracted from the JSON field.

XPath Query: XPath Query to specify the node within the JSON field.

Get nodes: select this check box to extract the JSON data of all the nodes specified in the XPath query list or select the check box next to a specific node to extract its JSON data only.

Is Array: select this check box when the JSON field to be extracted is an array instead of an object.

Advanced settings

Encoding

Select the encoding from the list or select Custom and define it manually. This field is compulsory for database data handling.

Usage in Storm Jobs

If you have subscribed to one of the Talend solutions with Big Data, you can also use this component as a Storm component. In a Talend Storm Job, this component is used as an intermediate step and other components used along with it must be Storm components, too. They generate native Storm code that can be executed directly in a Storm system.

The Storm version does not support the use of the global variables.

You need to use the Storm Configuration tab in the Run view to define the connection to a given Storm system for the whole Job.

This connection is effective on a per-Job basis.

For further information about a Talend Storm Job, see the sections describing how to create and configure a Talend Storm Job of the Talend Big Data Getting Started Guide.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs.

Related scenarios

No scenario is available for the Storm version of this component yet.