Skip to main content Skip to complementary content

tHiveInput properties for Apache Spark Streaming

These properties are used to configure tHiveInput running in the Spark Streaming Job framework.

The Spark Streaming tHiveInput component belongs to the Databases family.

This component is available in Talend Real-Time Big Data Platform and Talend Data Fabric.

Information noteImportant: Talend does not support the import of schema for complex data types such as array, struct, and map.

Basic settings

Hive storage configuration

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

If you are running your Spark Job on Spark Universal with Yarn Cluster mode, this property is not available. The Hive storage configuration directly comes from the XML files inside the Hadoop configuration JAR file. For more information, see Defining Yarn cluster connection parameters with Spark Universal.

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. This field is relevant only when you are using an on-premises distribution.

If you are running your Spark Job on Spark Universal with Yarn Cluster mode, this property is not available. The HDFS storage configuration directly comes from the XML files inside the Hadoop configuration JAR file. For more information, see Defining Yarn cluster connection parameters with Spark Universal.

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.

Always use lowercase when naming a field because the processing behind the scene could force the field names to be lowercase.

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.

 

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

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, see the Hive query language manual.

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

Hadoop provides different compression formats that help reduce the space needed for storing files and speed up data transfer. When reading a compressed file, Talend Studio needs to extract 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

Usage rule

This component is used as a start component and requires an output link.

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

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

In the Spark Configuration tab in the Run view, define the connection to a given Spark cluster for the whole Job. In addition, since the Job expects its dependent jar files for execution, you must specify the directory in the file system to which these jar files are transferred so that Spark can access these files:
  • Yarn mode (Yarn client or Yarn cluster):
    • When using Google Dataproc, specify a bucket in the Google Storage staging bucket field in the Spark configuration tab.

    • When using HDInsight, specify the blob to be used for Job deployment in the Windows Azure Storage configuration area in the Spark configuration tab.

    • When using Altus, specify the S3 bucket or the Azure Data Lake Storage for Job deployment in the Spark configuration tab.
    • When using on-premises distributions, use the configuration component corresponding to the file system your cluster is using. Typically, this system is HDFS and so use tHDFSConfiguration.

  • Standalone mode: use the configuration component corresponding to the file system your cluster is using, such as tHDFSConfiguration Apache Spark Batch or tS3Configuration Apache Spark Batch.

    If you are using Databricks without any configuration component present in your Job, your business data is written directly in DBFS (Databricks Filesystem).

This connection is effective on a per-Job basis.

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!