title: When using Spark structured streaming , how to just get the aggregation result of current batch, like Spark Streaming?
body: <p>One big different between Spark Structure Streaming (SSS) and Spark Streaming (SS) is SSS can leverage statestore. It can store aggregation result of previous batches and apply current result with previous result. So it can get the real aggregation result from the very beginning of the input stream.</p>
  
  <p>But for one case, we don't want to get the final result that merged with previous value of statestore. We just want to get (ouput) the aggregation result of current batch. And duo to the platform&amp;framework thing, we can't rollback to SS. </p>
  
  <p>So my question is, is it still doable in SSS to get the aggretation result of current batch, like SS?</p>
  
  <p>Taking word count application for example which is given in the spark structure streaming guide:
  <a href="https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html" rel="nofollow noreferrer">https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html</a></p>
  
  <p>When there is a "<code>cat cat</code>" comes in one batch, my expected output is <code>cat|2</code>.</p>
  
  <p>And when "<code>cat</code>" comes in next batch, my expected output is <code>cat|1</code></p>