Contents · From Talend Open Studio, select Run Job from the bottom panel. You will be connected to...

Post on 04-Aug-2020

0 views 0 download

transcript

Contents Create Hive Loading Job ................................................................................................................................ 2

Read & Extract CSV File on HDFS .................................................................................................................. 2

Create Hive Connection ................................................................................................................................ 3

Run Hive Server ............................................................................................................................................. 5

Create Hive Table .......................................................................................................................................... 6

Load Hive Table ............................................................................................................................................. 9

Read Product Table ..................................................................................................................................... 10

Close Hive Connection ................................................................................................................................ 12

Link every component as required ............................................................................................................. 12

Create Hive Loading Job

Create a job using Job Designs. Right Click on Job Designs and create the Job.

Click Finish.

Read & Extract CSV File on HDFS Create a product.csv file in local directory. Create HDFS job using tHDFSPut component from BigData

Palette. Fill all the details as below in Component Tab.

Create Hive Connection

Select Hive from BigData from Palette. Drag and drop tHiveConnection from Hive Palette in the newly

created job.

Select the tHiveConnection component and open the Component tab from the bottom panel. Fill all the

required details as below.

Run Hive Server

Start Hive Server in Linux OS. (Please make sure you have CDH3 installed in your local system).

Type the below command in shell prompt:

hive --service hiveserver

From Talend Open Studio, select Run Job from the bottom panel. You will be connected to Hive server.

Create Hive Table

Drag and drop tHiveCreateTable from BigData Palette. Select tHiveCreateTable component and fill the

component details as below.

Click on Edit schema.

Fill the schema details.

Ok.

Load Hive Table

Load product.csv file from local to Hive table “Product” in Talend Studio. Fill in the details as below in

Component Tab..

Read Product Table

Drag and drop tHiveRow from Hive Palette. Fill in the details as below in Component Tab.

Edit the schema.

Display the result in console Drag and drop tLogRow from Log & Errors. Fill the details as below in component tab.

Close Hive Connection

Drag and drop tHiveClose from Hive Palette. Fill in the details as below in Component Tab.

Link every component as required

Right Click on each component. Choose TriggerOn SubJob OK. Then link the connector to the required

component.

Run the job