Kafka connect (Single message transform) row filtering

左心房为你撑大大i 提交于 2019-12-09 01:31:42

问题


I read about Kafka connect transformations introduced in kafka 0.10.2.1 https://kafka.apache.org/documentation/#connect_transforms

I noticed that all the transformations are column based transformations. I have a use-case where I need value based filtering. For example:

consider the following dataset of a group of people:

{"firstName": "FirstName1", "lastName": "LastName1", "age": 30}
{"firstName": "FirstName2", "lastName": "LastName2", "age": 30}
{"firstName": "FirstName3", "lastName": "LastName1", "age": 60}
{"firstName": "FirstName4", "lastName": "LastName2", "age": 60}

I want my worker to filter all those records whose lastName is LastName2

Is it possible using kafka-connect or I need to write a separate program for this use-case.

Thanks


回答1:


No reason why you couldn't solve this with Single Message Transforms - but you'd need to write a custom one since what you're describing is not available through the transforms currently shipped.

This is a useful talk here on when to use, and not to use, SMTs: Kafka Summit New York 2017 : Single Message Transformations Are Not the Transformations You’re Looking For (Ewen Cheslack-Postava, Confluent)



来源:https://stackoverflow.com/questions/44426711/kafka-connect-single-message-transform-row-filtering

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!