apache / rocketmq-flink

RocketMQ integration for Apache Flink. This module includes the RocketMQ source and sink that allows a flink job to either write messages into a topic or read from topics in a flink job.
https://rocketmq.apache.org/
Apache License 2.0
141 stars 89 forks source link

rocketMQ connector how to handle nested json #24

Closed kongslove closed 2 years ago

kongslove commented 2 years ago

How do I handle nested json in SQL, use ROW or Map like kafka,such as : { "funcName": "test", "data": { "snapshots": [{ "content_type": "application/x-gzip-compressed-jpeg", "url": "https://blog.csdn.net/xianpanjia4616" }], "audio": [{ "content_type": "audio/wav", "url": " https://bss.csdn.net/m/topic/blog_star2020/detail?username=xianpanjia4616" }] }, "resultMap": { "result": { "cover": "/data/test/log.txt" }, "isSuccess": true }, "meta": { "video_type": "normal" }, "type": 2, "timestamp": 1610549997263, "arr": [{ "address": "北京市海淀区", "city": "beijing" }, { "address": "北京市海淀区", "city": "beijing" }, { "address": "北京市海淀区", "city": "beijing" }], "map": { "flink": 456 }, "doublemap": { "inner_map": { "key": 123 } } }

SteNicholas commented 2 years ago

@kongslove, you should use map() to handle the body of the MessageExt with the nested json.