如何忽略talend中特定列中包含null的行?

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

我的 talend 工作流程是:

但我想忽略特定列包含 NULL 的行。 有什么方法可以忽略特定列包含 NULL 的行吗?

您可以在 tMap 中使用过滤器来过滤掉空列:

tFileInputExcel -- tMap -- tDB..

在 tMap 输出过滤器中,您可以使用表达式:

row.Column != null

为了完成,如 alex 所述,您还可以检查空字符串:

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

我添加了一个 trim,以防字符串只包含空格。

如果导入的字段是String类型,我在使用Excel的时候发现在filter中使用如下:

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

As Excel 和 Talend 有时对给定字段中 NULL 的含义有不同的理解。