This is my partitionBy condition which i need to change based on the column value from the data frame .
val windowSpec = Window.partitionBy("col1", "clo2","clo3").orderBy($"Col5".desc)
Now if the value of the one of the column (col6) in data frame is I then above condition .
But when the value of the column(col6) changes O then below condition
val windowSpec = Window.partitionBy("col1","clo3").orderBy($"Col5".desc)
How can i implement it in the spark data frame .
So it is like for each record it will check whether col6 is I or O based on that partitionBy condition will be applied
filterbefore applying the window aggregation make sense? - Jacek Laskowski