Re: Spark Dataframe returning null columns when schema is specified

2017-09-08 Thread Praneeth Gayam
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

Spark Dataframe returning null columns when schema is specified

2017-09-07 Thread ravi6c2
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: