I am trying to add a column to my DataFrame that serves as a unique ROW_ID for the column. So, it would be something like this 1, user1 2, user2 3, user3 ... I could have done this easily using a hashMap with an integer iterating but I can't do this in spark using the map function on DataFrame since I can't have an integer increasing inside the map function. Is there any way that I can do this by appending one column to my existing DataFrame or any other way? PS: I know there is a very similar post, but that's for Scala and not java.
Thanks in advance