Skip to main content Skip to complementary content

tFileInputJSON Standard properties

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. 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.

Information noteWarning: 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

JDK version

Select the JDK version to be used. Note that a Standalone Nashorn JAR will be imported if you select JDK 11 and above. For JDK 8 to 11, Nashorn dependency is built in the JDK.

This option is available when you select JsonPath without loop from the Read By drop-down list in the Basic settings view.

Information noteNote:
  • This option is available only when you have installed the 8.0.1-R2023-01 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.
  • The JDK version changes from JDK 15 and above to JDK 11 and above and from JDK 8 - JDK 14 to JDK 8 to 11 only when you have installed the 8.0.1-R2023-02 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

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.

Include the Nashorn library

Select this option to include the Nashorn library. This option is necessary if you are using JDK 15 or a higher version.

This option is available when JsonPath without loop is selected from the Read By drop-down list in the Basic settings view.

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 more information about variables, see Using contexts and variables.

Usage

Usage rule

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

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!