tFileInputJSON Standard properties - 7.3

JSON

Version
7.3
Language
English
Product
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 Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > File components (Integration) > JSON components
Data Quality and Preparation > Third-party systems > File components (Integration) > JSON components
Design and Development > Third-party systems > File components (Integration) > JSON components
Last publication date
2024-02-21

These properties are used to configure tFileInputJSON running in the Standard Job framework.

The Standard tFileInputJSON component belongs to the Internet and the File families.

The component in this framework is available in all Talend products.

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. When you create a Spark Job, avoid the reserved word line when naming the fields.

  • Built-In: You create and store the schema locally for this component only.

  • Repository: You have already created the schema and stored it in the Repository. You can reuse it in various projects and Job designs.

Click Edit schema to make changes to the schema.
Note: If you make changes, the schema automatically becomes built-in.
  • 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.

Read By

Select a way of extracting JSON data in the file.

  • JsonPath: Extracts JSON data based on the JSONPath query. With this option selected, you need to select a JSONPath API version from the API version drop-down list. It is recommended to read data by JSONPath in order to gain better performance.

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

  • JsonPath without loop: Extracts JSON data based on the JSONPath query without setting a loop node.

Use Url

Select this check box to retrieve data directly from the Web.

URL

Enter the URL path from which you will retrieve data.

This field is available only when the Use Url check box is selected.

Filename

Specify the file from which you will retrieve data.

This field is not visible if the Use Url check box is selected.

Warning: Use absolute path (instead of relative path) for this field to avoid possible errors.

Loop Jsonpath query

Enter the Jsonpath or XPath of the node 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.

Die on error

Select this check box to stop the execution of the Job when an error occurs. Clear the check box to skip the row on error and complete the process for error-free rows. If needed, you can collect the rows on error using a Row > Reject link.

Advanced settings

Advanced separator (for numbers)

Select this check box to change the separator used for numbers. By default, the thousands separator is a comma (,) and the decimal separator is a period (.).

Thousands separator: define separators for thousands.

Decimal separator: define separators for decimals.

Use the loop node as root

Select this check box to use the loop node as the root for querying the file.

The loop node is set in the Loop Json query text frame in the Basic Settings view. If this option is checked, only the child elements of the loop node are available for querying; otherwise, both the parent elements and the child elements of the loop node can be queried. You can specify a parent element through JSON path syntax.

This check box is available only when JsonPath is selected in the Read By drop-down list of the Basic settings view.

Validate date

Select this check box to check the date format strictly against the input schema.

This check box is available only if the Read By XPath check box is selected.

Encoding

Select the encoding type from the list or select Custom and define it manually. This field is compulsory for DB 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

Global Variables

NB_LINE: the number of rows processed. This is an After variable and it returns an integer.

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.

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

Usage rule

This component is a start component of a Job and always needs an output link.