How to ignore row which contain null in specific column in talend?

Viewed 2065

My talend job process is:

  • Read excel file
  • Insert Row in Table.

But I want to ignore row which contain NULL for specific column. Is there any way to ignore row which contain NULL for specific column?

2 Answers

You can use a filter in a tMap to filter out null columns :

tFileInputExcel -- tMap -- tDB..

in the tMap output filter, you can use the expression :

row.Column != null

For the sake of completion, as mentioned by alex, you can also check for empty string:

row.Column != null && !row.Column.trim().isEmpty()

I've added a trim, in case the string contains only whitespaces.

If the imported field is of String type, I have found when using Excel to use the following in the filter:

!Relational.ISNULL(row.Column) && row.Column.length() > 0

As Excel and Talend sometimes have a different understanding of what NULL is in a given field.

Related