Talend Filter Columns

The Talend Filters Columns component is useful for filtering the source column values and providing the output. If you have N number of columns in the source data, and you want only a few columns, then you can use this Filters Columns field.

To demonstrate the Talend filter columns field, we are using the customer’s table available in the SQL Server database.

Customer Sales Table with HireDate

Talend Filter Columns Example

First, we established a connection to Microsoft SQL Server. Next, we used Talend DBinput to select the customer table within a database.

Talend Filter Columns 2

Drag and drop the Talend filter columns field into the design area. As you can see from the below screenshot, Talend tfiltercolumns map input columns with output columns. The mapping is based on column names.

Talend Filter Columns 3

Please connect the DBInput main row to the Talend filter columns field. As you can see from the below tfiltercolumns image, there is nothing much you can do in the filter columns component tab.

Click on the Edit schema button to check the input and tfiltercolumns output fields, and change as per your requirement. Here, we removed the Education Column and altered the position of the Hire date.

Edit Shema and change Data type and lengths

Next, drag and drop the DBOutput field and use the existing connection. As you can see, we are using the Talend_Filter_Column table as the destination. This job will create this table if it doesn’t exist; otherwise, it will drop the existing one and create a new table.

Talend Filter Columns 7

Let us run the Talend tfiltercolumns job.

Talend Filter Columns 8

From the below SQL query, you can see there is no Education column, and the order of the columns has changed as we specified in the Edit schema window.

Result Table