简体   繁体   中英

How to get structured JSON using KSQL?

There are two tables in the database . For example: Layouts(Id, VenueId, Description) and Venues(Id, Adress, Phone). Layout table has reference key to Venues. There are also two topics in Kafka accordingly tables. How can I send into my output topic JSON like this:

{
  "Id": "1",
  "Description": "LayoutDesc",
  "Venue": {
    "Id": 5,
    "Adress": "VenueAdress",
    "Description": "VenueDesc"
  }
}

As of 5.1.1 you can't construct nested objects in KSQL (you can only read them). There is an open issue for this, please do upvote/comment on it: https://github.com/confluentinc/ksql/issues/2147

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM