You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Timothy Bess <td...@gmail.com> on 2022/11/18 20:10:41 UTC

Flink SQL JSON

Hi Flink Users,

I use Flink SQL to ETL Kafka event data into tables we use for analysis,
and I'm currently trying to use it to basically extract a few fields out of
some JSON, but leave the original blob in a subdocument using the
elasticsearch connector.

I see that there is `ROW` and `MAP` but I don't see any data types for
unstructured JSON blobs. This would be really useful for both `jsonb`
columns in Postgres and subdocuments in Elasticsearch. Has anyone found a
good solution for this?

Thanks,

Tim

Re: Flink SQL JSON

Posted by yuxia <lu...@alumni.sjtu.edu.cn>.
Hi! 
Maybe you can map it to Flink's BINARY / VARBINARY type [1]. 

[1] https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/formats/json/#data-type-mapping 

Best regards, 
Yuxia 


发件人: "Timothy Bess" <td...@gmail.com> 
收件人: "User" <us...@flink.apache.org> 
发送时间: 星期六, 2022年 11 月 19日 上午 4:10:41 
主题: Flink SQL JSON 

Hi Flink Users, 

I use Flink SQL to ETL Kafka event data into tables we use for analysis, and I'm currently trying to use it to basically extract a few fields out of some JSON, but leave the original blob in a subdocument using the elasticsearch connector. 

I see that there is `ROW` and `MAP` but I don't see any data types for unstructured JSON blobs. This would be really useful for both `jsonb` columns in Postgres and subdocuments in Elasticsearch. Has anyone found a good solution for this? 

Thanks, 

Tim