all-things-risingwave
How to use JSONB array as an SQL datatype and stream data from a Kafka topic in a table?
I am trying to use a JSONB array as an SQL datatype and stream data from a Kafka topic into a table. However, I am facing issues with mapping the data properly. How can I achieve this?
Jf
Jf p
Asked on Jul 07, 2023
-
To use JSONB array as an SQL datatype, you can define the column as
jsonb[]
in the table creation. -
When streaming data from a Kafka topic, ensure that the column names in the
create source
statement match the keys in the JSON event. -
To stream data with embedded arrays of JSON, define the column as
jsonb[]
in thecreate source
statement. -
Use
SOME_COLUMN::jsonb
for casting instead ofto_jsonb
. -
Check the log in the compute node for any errors and ensure you are using the latest version of the platform.
Jul 07, 2023Edited by