I have pyspark Dataframe as follows,
I need to add EOM column to all the null values for each id dynamically based on last non null EOM value and it should be continuous.
My output dataframe looks like this,
I have tried this logic
df.where("EOM IS not NULL").groupBy(df['id']).agg(add_months(first(df['EOM']),1))
but the expected format is different