title: KafkaStreams: Getting Window Final Results
body: <p>Is it possible to get <a href="https://kafka.apache.org/21/documentation/streams/developer-guide/dsl-api.html#window-final-results" rel="noreferrer">window final result</a> in Kafka Streams by suppressing the intermediate results.</p>
  
  <p>I can not achieve this goal. What is wrong with my code? </p>
  
  <pre><code>    val builder = StreamsBuilder()
      builder.stream&lt;String,Double&gt;(inputTopic)
              .groupByKey()
              .windowedBy(TimeWindows.of(Duration.ofSeconds(15)))
              .count()
              .suppress(Suppressed.untilWindowCloses(unbounded())) // not working)
              .toStream()
              .print(Printed.toSysOut())
  </code></pre>
  
  <p>It leads to this error: </p>
  
  <pre><code>Failed to flush state store KSTREAM-AGGREGATE-STATE-STORE-0000000001: 
  java.lang.ClassCastException: org.apache.kafka.streams.kstream.Windowed cannot be cast to java.lang.String
  </code></pre>
  
  <p>Code / Error details: <a href="https://gist.github.com/robie2011/1caa4772b60b5a6f993e6f98e792a380" rel="noreferrer">https://gist.github.com/robie2011/1caa4772b60b5a6f993e6f98e792a380</a></p>