I read data from a csv file ,but don\'t have index.
I want to add a column from 1 to row\'s number.
What should I do,Thanks (scala)
For SparkR:
(Assuming sdf is some sort of spark data frame)
sdf<- withColumn(sdf, "row_id", SparkR:::monotonically_increasing_id())