title: Rank a Spark stream dataset column
body: <p>Im using Spark 2.3.1's Structured Streaming API. Is it possible to rank values in a column of a spark stream dataframe? I tried using the following code to then realize after the exception message that its not possible for stream context to iterate over the entire window.</p>
  
  <pre><code>.withColumn("rank", row_number().over(Window.orderBy($"transactionTime")))
  </code></pre>
  
  <p>throws</p>
  
  <blockquote>
    <p>org.apache.spark.sql.AnalysisException: Non-time-based windows are not supported on streaming DataFrames/Datasets</p>
  </blockquote>
  
  <p>Can anyone help me with an idea to calculate rank/percentile? </p>