14 Star 63 Fork 17

HappyJoeJoe / go-bin2es

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
binlog2es.json 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
jiabozhou 提交于 2020-05-28 19:50 . 优化
[
{
"schema":"test",
"tables": [
"Parent",
"Child"
],
"actions":["insert", "update"],
"pipelines": [
{
"DoSQL":{
"sql":"SELECT Parent.id, Parent.name, Parent.sex, group_concat(concat_ws('_', Child.name, Child.sex) separator ',') as Childs FROM Parent join Child on Parent.id = Child.parent_id WHERE (?) GROUP BY Parent.id",
"placeholders":{
"Parent":"id",
"Child":"parent_id"
}
}
},
{
"Object":{
"common":"profile",
"fields":{
"name":"es_name",
"sex":"es_sex"
}
}
},
{
"NestedArray":{
"sql_field":"Childs",
"common":"childs",
"pos2fields":{
"es_name":1,
"es_sex":2
},
"fields_seprator": "_",
"group_seprator": ","
}
},
{
"SetDocID": {
"doc_id": "id"
}
}
],
"dest":{
"index":"test_es"
}
}
]
Go
1
https://gitee.com/happyjoejoe/go-bin2es.git
git@gitee.com:happyjoejoe/go-bin2es.git
happyjoejoe
go-bin2es
go-bin2es
master

搜索帮助