I was trying to create a spark dataframe(using scala) from a csv that has entries like this: This is a single row entry of 5 columns:
{"username":"john_doe, "id":"123411"} true 0 5 {"country":"IN", "city":"BOM"}
So, some columns are in JSON format are some are not. I did write some code to process the JSON columns as a String and directly add them row-wise as a String to a dataframe, but the other columns which are left I have to manually add them to the dataframe, which is turning out to be a costly process since I create a separate dataframe, add an "id" column to it, do a natural join, drop the "id" column every time.
Any help will be appreciated!