I have a json file in input to a pyspark program and I need to derive a target mapping based on columns present in source.
In some cases the json file may not contain some attributes, at that time select statement fails with key error.
I need a way to select attributes from pyspark dataframe, if that attributes is not present in source then return Null to the target column.
I couldn’t see the logic to implement this with some standard pyspark function.