seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

when input is hive,output is mongodb,how to set the data can update by a column

Open celestewang1026 opened this issue 7 years ago • 4 comments

I used waterdrop ,the input is hive,the output is mongodb, 1.how I set a bussiness key ,like user_id mapping the mongo primary_key=_id. 2.how I set can make the data that to mongdb is update ,not insert by primary_key

celestewang1026 avatar Mar 01 '19 06:03 celestewang1026

我猜测,需要自定义一个input 和outPut吧

xu0612204126 avatar Mar 01 '19 08:03 xu0612204126

@kid-xiong 解答一下

garyelephant avatar Mar 01 '19 12:03 garyelephant

1.如果你想将业务唯一key变成_id,直接在sql里写就行了,例如 select user_id as _id ....;如果你的唯一key是多个字段组成,select concat(field_1,'-',field_2.....) as _id 2.在你的mongoDBOutput增加一个参数:writeconfig.replaceDocument = "false";就可以起到update的效果了 有什么不明白的可以+我微信 374545700

kid-xiong avatar Mar 01 '19 13:03 kid-xiong

1.如果你想将业务唯一key变成_id,直接在sql里写就行了,例如 select user_id as _id ....;如果你的唯一key是多个字段组成,select concat(field_1,'-',field_2.....) as _id 2.在你的mongoDBOutput增加一个参数:writeconfig.replaceDocument = "false";就可以起到update的效果了 有什么不明白的可以+我微信 374545700

get it! Thks,but for where I can get all params like "writeconfig.replaceDocument"

celestewang1026 avatar Mar 04 '19 02:03 celestewang1026