I have the following Spark dataframe that is created dynamically:
val sf1 = StructField(\"name\", StringType, nullable = true) val sf2 = StructField(\"sector
simple collect result and then apply foreach
df.collect().foreach(println)