What is the desired behaviour when a field is null for only a few records?
You can not avoid nulls in this case
But if all rows are guaranteed to be uniform(either all-null are
all-non-null), you can *take* the first row of the DF and *drop* the
columns with null fields.
On Fri, Sep 8, 2017 at
Hi All, I have this problem where in Spark Dataframe is having null columns
for the attributes from JSON that are not present. A clear explanation is
provided below:
*Use case:* Convert the JSON object into dataframe for further usage.
*Case - 1:* Without specifying the schema for JSON: