Re: Could you please give me a hand about json object in flink sql

2022-04-02 Thread Qingsheng Ren
Hi, If the schema of records is not fixed I’m afraid you have to do it in UDTF. Best, Qingsheng > On Apr 2, 2022, at 15:45, wang <24248...@163.com> wrote: > > Hi, > > Thanks for your quick response! > > And I tried the format "raw", seems it only support single physical column, > and in

Re: Could you please give me a hand about json object in flink sql

2022-04-02 Thread Qingsheng Ren
Hi, You can construct the final json string in your UDTF, and write it to Kafka sink table with only one field, which is the entire json string constructed in UDTF, and use raw format [1] in the sink table: CREATE TABLE TableSink ( `final_json_string` STRING ) WITH ( ‘connector’ = ‘kafk

Re: Could you please give me a hand about json object in flink sql

2022-04-01 Thread Qingsheng Ren
Hi, I’m afraid you have to use a UDTF to parse the content and construct the final json string manually. The key problem is that the field “content” is actually a STRING, although it looks like a json object. Currently the json format provided by Flink could not handle this kind of field defin