import org.apache.spark.sql.functions.{col, monotonically_increasing_id}
df.withColumn("id",monotonically_increasing_id()).show(1000)
import org.apache.spark.sql.functions.{col, monotonically_increasing_id}
df.withColumn("id",monotonically_increasing_id()).show(1000)