all-things-risingwave

How to extract nested JSON from Maxwell format into columns?

I want to extract nested JSON data from Maxwell format into separate columns. For example, if I have {'database':'test', 'data':{'id':1}}, how can I extract the 'id' field from the nested 'data' object into a separate column?

ma

mahmoud elhalwany

Asked on Jan 25, 2023

  1. Each field in the nested JSON corresponds to a column in the extraction.

  2. Use the CREATE SOURCE statement with the appropriate column definitions to extract the nested JSON data.

  3. Maxwell parser can extract fields in the nested 'data' object, assuming all CDC events in a topic are generated by the same table.

Example: CREATE SOURCE s (id int) WITH (...) ROW FORMAT MAXWELL;

Jan 26, 2023Edited by