1

I got reference from Can I change the nullability of a column in my Spark dataframe? ; but it didn't work for my case.

I have a field Schools and it is of nested Struct Type

StructField(schools,ArrayType(StructType(List(StructField(name,StringType,true),StructField(category,StringType,true),StructField(district,StringType,true))),true),true)

I want to change the nullability of name and category, how can I do that ?

I have tried df.schema["schools.name"].nullable = False, but it didn't work.

Ezio
  • 376
  • 5
  • 21

0 Answers0