title: How to forward fill tumbling window in Spark?
body: <p>I have some time series data with a "timestamp" column. The tumbling window function helps generate snapshots like so:</p>
  
  <pre><code>val q = cleanDF.withColumn("window", window($"timestamp","5 minutes"))
  val w = Window.partitionBy($"window").orderBy($"timestamp".desc)
  val snaps = q.withColumn("rn",row_number.over(w)).where($"rn"===1).drop("rn").drop("window")
  </code></pre>
  
  <p>For windows with no data, how do I forward fill with the last known good value?</p>