I've got a dataframe and I want to add another column which for the first n rows is one value, and for the rest is the value in another column... something like this
frame.select("*")
.withColumn("newColumn", if(row number < 5) "hello, world" else col("someth_else"))
Spark.