【详述】routine load加载kafka binlog数据时想新增$.data外层的table字段
【背景】kafka binlog一个topic存在多个表的数据,需要过滤出指定表的数据进行routine load的接入。
想到的方法是将database和table的名字加在字段里面,用where来过滤
【业务影响】
【StarRocks版本】1.19
binlog数据如下:
{
“data”: [{
“dt”: “2022-07-12”,
“id”: “001”,
“user_id”: “aaa”
}, {
“dt”: “2022-07-12”,
“id”: “002”,
“user_id”: “bbb”
}],
“database”: “database”,
“table”: “table001”,
“ts”: 1657627027884,
“type”: “INSERT”
}
使用routine load配置如下:
PROPERTIES
(
“desired_concurrent_number”=“1”,
“max_batch_interval” = “20”,
“max_batch_rows” = “300000”,
“max_batch_size” = “209715200”,
“strict_mode” = “false”,
“format” = “json”,
“json_root”="$.data",
“strip_outer_array” = “true”,
“max_error_number” = “99999999999999”
)
此时可以load数据,但是想把外层的"database": “database” 和 “table”: "table001"加入在每行数据里面怎么操作?
暂不支持这样拆多行导入的操作。