Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have to insert records in 500 columns.
I need to replace all the null values with a particular string line 'NA' for all the colums.
We can do it by checking null value for all the columns individually.
Is there any better way to achieve this ?
Checking if is null for every column may yield an unwanted overhead at the processing front...instead you may put in default value for these columns at the tmap expression level either at the input or output as that suits your requirements.
I Have very limited knowledge on Talend and trying to catch up with this Tool....hopefully that works
The above answers are great, I didn't even know you could have default values in a tMap.
I was going to suggest the same as the second reply, use a tJavaRow component because you can type faster than having to do 500+ clicks on a tMap.
Add tJavaRow, click generate Code, it will be something like this:
output_row.column1 = input_row.column1;
change it to:
output_row.column1 = (input_row.column1 == null) ? "N/A" : input_row.column1;
this says, if column1 is null, then use "N/A" else use column1.