The schema inference is broken on spark 2.2.0 due to changes in TypeCoercion.
SPARK-160 Cannot read dataframe from collection