Requirement : Need to populate 4 digit row number with prefix 000
Example : 0001,0002.....0011,0012
Here I am repeating number of zero to prefix based on the length of the row number value i.e in column PAGENO
df.select(F.repeat(F.lit(0), 3))
The value 3 needs to change dynamically based on row number value.
My idea to achive dynamic 0 replication:
df.select(F.repeat(F.lit(0),(4 - F.length(df["PAGENO"]))))
getting error:
'Column' object is not callable
When passing any column or parameter instead of just numeric 3 as no of times repeat should work.