liuxuzxx opened a new issue, #53004:
URL: https://github.com/apache/doris/issues/53004

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   Flink CDC 3在做同步的时候,能够获取到数据库的:insert,update,delete操作。目前发现debezium对应的三种格式如下:
   
   1. insert格式
   
   ```json
   {
       "before": null,
       "after": {
           "user_id": 5859346,
           "enterprise_id": 192661,
           "timeinterval": 30,
            ......还有很多字段,省略
       },
       "op": "c",
       "source": {
           "db": null,
           "table": "kafka_gsms_user_info"
       }
   }
   ```
   
   2. update格式
   
   ```json
   {
       "before": {
           "user_id":5859346,
           "enterprise_id": 192661,
           "timeinterval": 90,
           ......省略
       },
       "after": {
           "user_id": 5859346,
           "enterprise_id": 192661,
           "timeinterval": 30,
            ......还有很多字段,省略
       },
       "op": "u",
       "source": {
           "db": null,
           "table": "kafka_gsms_user_info"
       }
   }
   ```
   
   3. delete格式
   
   ```json
   {
       "before": {
           "user_id":5859346,
           "enterprise_id": 192661,
           "timeinterval": 90,
           ......省略
       },
       "after": null,
       "op": "u",
       "source": {
           "db": null,
           "table": "kafka_gsms_user_info"
       }
   }
   ```
   
   对应的Routine Load为:
   
   ```sql
   create routine load sedp_test.gsms_user_info_rl on gsms_user_info properties 
(
       "format" = "json",
       "json_root" = "$.after"
   )
   FROM KAFKA (
           "kafka_broker_list" = 
"172.16.1.118:9092,172.16.1.135:9092,172.16.1.149:9092", 
           "kafka_topic" = "kafka_gsms_user_info", 
            "kafka_offsets" = "266565,0,0", 
           "kafka_partitions" = "0,1,2", 
           "property.group.id" = "doris_gsms_user_info_cg"
       );
   ```
   
   ### What's Wrong?
   
   当在insert/update格式的时候,上买年的Routine Load能够正确处理。但是在delete格式的时候无法正确处理,会报错: 
$.after是null.
   
   看到delete格式的情况下,确实$.after是null. 
   
   ### What You Expected?
   
   期望:Routine Load能够支撑insert/update/delete三种动作
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to