Spark : How to get corrupt_record column in dataframe for JSON Array Schema using from_json?

Viewed 26

Currently I am getting JSONArray String from Kafka which may be corrupted . I tried defining schema of ArrayType but then how can I get corrupt_record field in dataframe ?

Correct
[{"event":"test","properties":{"p1":"v1"}}]

Corrupt Record
{"corrupt_key":"value"}
0 Answers
Related