How to create monotonic function to incrementally add obj_id for datasource in pyspark

SandhyaDB
New Contributor

I have used monotonically_increasing_id() to add unique to datasource .However , this does not add unique id in increasing number ..Its kind of random.How to perform this in pyspark.