Saturday, 10 July 2021

Talend UI Introduction

Talend is a ETL tool which has ability to transform data and have many components to perform ETL operation to deal with data with minimum coding effort. 

Lets check the UI for Talend Data Integration .


You can find different section in UI is default view of perspective.

Repository 

I has list of job saved, context, code, metadata etc. information. Basically It has all code language save which used to complete the job run. 

Job View (Designer) 

It has job view which contain connected components for ETL purpose. You can say that it is a logical view of your code.

Job View (Code) 

Whenever we drop component to the designers widow, respective java code is available in the code section. If  job has any code error we can check in the code section and correct them in designer.

Palette

This part contents the components which is available to create a ETL job. The number of components may change according to edition like open studio or enterprise, also change according to tool and version.


Wednesday, 7 July 2021

PRE JOB AND POST JOB ACTIVITY WHICH SHOULD FOLLOW IN TALEND ETL

 Talend is a well known ETL tool nowadays. It’s based on java language and you can use your own java code with help of pre available components. Talend also provides facilities to developers to design their own component using JAVA code.

Most of the ETL have the same strategy like move data with needed transformation from source to target, but one should consider some basic points for pre and post job activities in Talend as best practices.

  • Open and close DB connections-

When we need to deal with any database component like tOracleinput , tMysqlinput etc  then the best practice is use DB connection components.

For example if you want to deal with oracle DB then you can use tOracleConnection component to connect with oracle and latter you can you same connection in any oracle DB component like tOracleOutput, tOracleCommit, tOracleRollback etc. The mandatory thing is, tOracleConnection should run first or place before any other component which is going to use the same connection.

Steps for using connection in other components-

  1. Suppose to be using tOracleInput component, then open component setting.

  2. Open basic setting option.

  3. Tick yes on ‘USE EXISTING CONNECTION’ option.

  4. You can find the list of available connections in the component list.

  5. Select your required connection for perform any action on particular connection.


In order to close a running session on DB we need to use a close connection component at the end of the job. For a given  example you can use tOracleClose at the end of a job.

Sunday, 28 October 2018

Bulk Mail Using tSendMail Component in Talend

Talend ETL has given a very simple interface and availability to everyone to manage the data and apply transformation as needed. In this blog we are going to discus about a very useful example of Bulk Mail.

If you want to send multiple emails and you have data ready with you like receiver address, message for the receiver, your SMTP setting than one can easily send multiple emails in one go.

Suppose you want to send a intimation to your customer for pending amounts and you have few customer than it is simple possible with your mailbox, but if you have thousands of customer and have to send amount information to related to that customer only than talend with help you simply using tSendMail component.

Case: For example you have customer info like Customer Number(CNO), customer name(CNAME), cusomer mail id(EMAIL), pending amount( AMT), Message(MSG)[Its is an concatenation of CNO, CNAME, AMT with your message body]  in XLS doc of any database table then you can process it by talend.
In this example we are taking XLS doc as data source.

Sample Doc

Steps are following

  • Create a metadata for XLS file.
    TALEND ETL
    XLS file metadata
  • Create a new job.
  • Place tFileInputExcel component, open basic setting, chose property type Repository and select your XLS metadata from available XLS. In this example EMAIL is our Excel file. Define metadata in built in properties also available in same component.
    Talend ETL
    tFileInputExcel Basic settings
  • Next we have to add tSetGlobalVar for create global variables which we are going to use in tSendMail component. In the basic setting of the component we have to define key and value pair. In this example I am using same variable name as column name. One can use any name for variable. For setting the name Key is the name of variable and the Value is define the value to that variable. One can also hardcode the values, but in over case we are going to assign first row of XLS doc. For that we can use a row name coming from XLS component, here we can see this it is “row1”, so we can assign variable “CNO” value as row1.CNO and so on.
    tSetGlobalVar
    tSetGlobalVar Basic Setting
  • For printing the variable values I used tlogrow component, which is not going to perform any important role in this job, one can also skip the component.
  • At last connect tSendmail component and go to the basic settings.
     tSendMail
    tSendMail Settings (a)
    • TO>>  Assign the value of global variable EMAIL like ((String)globalMap.get("EMAIL"))
    • From>> Your Mail address
    • If you want to show sender name to the receiver than you can hardcoded the values.
    • Cc>> Any email ID if you need for verification.
    • SUBJECT>> Subject line of your mail
    • MESSAGE>> Assign the message values from variable MSG like ((String)globalMap.get("MSG"))
       tSendMail
      tSendMail Settings (b)
    • SMTP Host>> One can use their SMTP setting, for example I am simply using my Gmail which has Host Name as "smtp.gmail.com".
    • SMTP port>> Port no of host, for Gmail it is 587 for outgoing mail.
    • Enable STARTTLS support.
    • Use you ID and password in between “”
  • All set for run the job
Drop me comments if you like and write me for Expoted job and sample Excel file.