Suppose you have a table with a string column that has JSON data encoded in it, like this one below, and you want to parse and query on the data of this column.
val df = Seq(
("{\"id\":1,\"amount\":{\"value\":60,\"currency\":\"BRL\"}}"),
("{\"id\":2,\"amount\":{\"value\":70,\"currency\":\"USD\"}}")
).toDF("my_json_col")
Software Engineer and Data Scientist