tHiveInput properties in Spark Batch Jobs - 6.1

Talend Components Reference Guide

English (United States)
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
Talend Studio
Data Governance
Data Quality and Preparation
Design and Development

Component family

Databases / Hive


Basic settings

Hive storage configuration

Select the tHiveConfiguration component from which you want Spark to use the configuration details to connect to Hive.


HDFS Storage configuration

Select the tHDFSConfiguration component from which you want Spark to use the configuration details to connect to a given HDFS system and transfer the dependent jar files to this HDFS system.

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.


Input source

Select the type of the input data you want tHiveInput to read:

  • Hive table: the Database field and the Table name field are displayed. You need to enter the related information about the Hive database to be connected to and the Hive table from which you need to read data.

  • Hive query: the Hive query field is displayed. You need to enter the Hive query statement you want to use to select the data to be used.

  • ORC file: the Input file name field is displayed and the Hive storage configuration list is deactivated, because the ORC file should be stored in your HDFS system hosting Hive. You need to enter the directory where the file to be used is stored.

For further information about the Hive query language, see


Compressed data in the form of Gzip or Bzip2 can be processed through the query statements. For details, see

Hadoop provides different compression formats that help reduce the space needed for storing files and speed up data transfer. When reading a compressed file, the Studio needs to uncompress it before being able to feed it to the input flow.

Advanced settings

Register Hive UDF jars

Add the Hive user-defined function (UDF) jars you want tHiveInput to use. Note that you must define a function alias for each UDF to be used in the Temporary UDF functions table.

Once you add one row to this table, click it to display the [...] button and then click this button to display the jar import wizard. Through this wizard, import the UDF jar files you want to use.

A registered function is often used in a Hive query that you edit in the Hive Query field in the Basic settings view. Note that this Hive Query field is displayed only when you select Hive query from the Input source list.


Temporary UDF functions

Complete this table to give each imported UDF class a temporary function name to be used in the Hive query in the current tHiveInput component.

Usage in Spark Batch Jobs

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

This component should use a tHiveConfiguration component present in the same Job to connect to Hive.

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.


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

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.