Sometimes we need to multiply rows based on a column in that row, multiple columns in that row, or by some other factor dependent on the row. In Talend there is a really nice mechanism that allows this to be done quite simply....but it is not very well known about. This QuickTip shows how to use this functionality with a very basic example.
Lets say we have some data which has a numeric column indicating how many times that row should be multiplied. For example....
We have all been there. You create a job with a tMap and it fails due to some problem in the tMap config. Many times it is due to something connected to data being null. Maybe you have a "compareTo" checking a String that is null or a "parseInt" trying to convert some non-numeric text to an Integer. They are common issues, but they are generally pretty tricky to identify so that you can cater for situations in which they occur. That is if you do not use a trick that is very useful and surprisingly very rarely used.
Sometimes it is useful to be able to compare a column against the same column in a previous row within a dataset. A simple example of this requirement might be as follows. You have a collection of orders that are sorted by Order Number and Date. An Order Number is usually unique, however there can be amendments made. You are tasked with identifying original Orders and Amended Orders. Original Orders will always be the first Order record created.
I was asked not so long ago how to dynamically change a connection in a Talend Job. I was curious about a use case for this as I hadn't really considered doing this before. The use case was that they had a standard job that they wanted to reuse across all of their environments. "Why not use the Context Variables?" was my response. I was then given the real reason that this is needed. Some of their environments used a SID to connect, others used a Service Name (they were using Oracle). If you look at the tOracleConnection component, you cannot parameterise this.