Adding unique id to Dataframe

using this function

.toDF().withColumn("uid", monotonically_increasing_id)