kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "刘波" <1091643...@qq.com>
Subject how to use SMT to transform a filed value in kafka connect?
Date Tue, 10 Jul 2018 10:48:17 GMT
Hi all,
I'm new to kafak. I'm using kafka to build a ETL program.


Here's my scinaro,
My jdbc connect  table t_user have a column sex which is int in mysql,  and use 0 to represent
male, 1 to represent female.


I want change sex value when 0 then 100, when 1 then 200.


below is my connecter config:
{
    "name":"trans-sex",
    "config":{
        "connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector",
        "connection.url":"jdbc:mysql://10.4.89.214:3306/test?user=root&password=root",
        "mode":"timestamp",
        "table.whitelist":"t_user",
        "validate.non.null":false,
        "timestamp.column.name":"login_time",
        "topic.prefix":"nobinlog.",
	 
        "transforms": "convert_sex", 
        "transforms.convert_sex.type": "org.apache.kafka.connect.transforms.ReplaceField$Value",
    
        "transforms.convert_sex.renames": "0:100,1,200"  


    }
}



any ideas,
thanks a lot
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message