Friday, July 17, 2015

Sharing database connection in Talend

Hi all,
Many times we work with multiple job and using same database table with many connections.
So here what I am going to tell you, how you can use db connection in many jobs.

Let say I have 5 jobs namely job0, job1, job2, job3 and job4.
In the below picture you can see a connection and 4 jobs, I am passing job0 connection into other jobs.


so in above picture we are making connection that will be share in other jobs. to do so just tick on checkbox use or register shared DB connection. this is job 0.

So now in above picture we just put connection component and use already created connection (in job0). we will do the same for job1,job2,job3 and job4 in order to use shared connection.

Thursday, July 16, 2015

Talend Date Functions

Here are some Talend useful functions...

1. TalendDate.getPartOfDate("DAY_OF_MONTH","2015-12-29");
Output: 29
Note: input date shuld be in date datatype.

2. TalendDate.getLastDayOfMonth("2015-12-13");
Output: 2015-12-31

3.TalendDate.getFirstDayOfMonth("2015-12-13");
Output: 2015-12-01

4. TalendDate.getCurrentDate();
Output: return current date in date datatype.

5. TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","2015-12-23 15:12:11");
Output: Wed Dec 23 15:12:11 IST 2015 (in date datatype).

Monday, July 13, 2015

Talend IO Disc Space Error with mysql input

While working with huge data set we may face disc space error.
By enabling stream we can fix this error. See the below image for details.

Friday, July 10, 2015

Use of tHashOutput and tHashInput in Talend

These components can be used of temporary data storage like tBufferOutput and tBufferInput.
But tHashOutput and tHashInput are much faster than like tBufferOutput and tBufferInput.


tHashOutput and tHashInput not comes by defult in component list, you have to update settings
in order to activate them.

Following are the steps to activate them-


Click on Technical Folder icon and than click on right arrow icon.
Now its activated and you can use it in you jobs.

Monday, June 29, 2015

Getting value from input box in Talend

This post give you an idea how we can get input from user in run time.












 We use tMsgBox for this. In the above example I use tJava for validation as you can see I connected tMySqlInput (core_mysql) with IF condition.

in IF I wrote the condition-

!Relational.ISNULL((String)globalMap.get("tMsgBox_1_RESULT"))

It means if no values provided in msgbox no flow will be execute.

And in mysql input I used the code-

SELECT * FROM `temp_cust` where `E_ICO1_CD`='"+((String)globalMap.get("tMsgBox_1_RESULT"))+"'"

Wednesday, June 17, 2015

MySql useful things

How to know your database character set-

SELECT default_character_set_name FROM information_schema.SCHEMATA S
WHERE schema_name = "dbName";

Thursday, March 19, 2015

Pentaho DI arguments, parameters, and variables

Arguments
A PDI argument is a named, user-supplied, single-value input given as a command line argument (running a transformation or job manually from Pan or Kitchen, or as part of a script). Each transformation or job can have a maximum of 10 arguments.

Parameters

Parameters are like local variables; they are reusable inputs that apply only to the specific transformation that they are defined in. When defining a parameter, you can assign it a default value to use in the event that one is not fetched for it. This feature makes it unique among dynamic input types in PDI.

Note: If there is a name collision between a parameter and a variable, the parameter will take precedence.

To define a parameter, right-click on the transformation workspace and select Transformation settings from
the context menu (or just press Ctrl-T), then click on the Parameters tab.

Variables
A variable in PDI is a piece of user-supplied information that can be used dynamically and programmatically in a variety of different scopes. A variable can be local to a single step, or be available to the entire JVM that PDI is running in.

PDI variables can be used in steps in both jobs and transformations. You define variables with the Set Variable step in a transformation, by hand through the kettle.properties file, or through the Set Environment Variables dialogue in the Edit menu.

TheGet Variable step can explicitly retrieve a value from a variable, or you can use it in any PDI text field that has the diamond dollar sign icon next to it by using a metadata string in either the Unix or Windows formats:

${VARIABLE}
%%VARIABLE%%

Source: Pentaho user guide