spark structured streaming using different schema for each row based on message type

Viewed 56

The application is streaming from a kafka topic that gets messages with different structure. The only way to know which structure it is, is to use the message key. Is there a way to apply a schema based on the message type. Such as use a function in the from_json method and pass the key into this fuction.

0 Answers
Related