puneeth1999 opened a new pull request, #24416:
URL: https://github.com/apache/kafka/pull/24416

   ### Problem
   
   Calling `suppress()` on a windowed aggregation fails with a 
`ClassCastException` when an application relies solely on default serdes 
(`default.key.serde` / `default.value.serde`) without passing explicit serdes 
via `Grouped` or `Materialized`:
   
   ```text
   ClassCastException: class org.apache.kafka.streams.kstream.Windowed cannot 
be cast to class java.lang.String
   ... invoking processor: KTABLE-SUPPRESS-0000000003
   ```
   
   Previously, windowed aggregations wrapped the user's key serde in a windowed 
serde only if `materializedInternal.keySerde() != null`. When only default 
serdes are configured, `keySerde()` is `null`, causing the resulting KTable key 
serde to remain `null` as well. Consequently, the suppression buffer fell back 
to the raw default key serde (e.g., `StringSerde`) and attempted to serialize a 
`Windowed<String>` directly.
   
   This issue affects time, sliding, and session windows, including their 
cogrouped variants.
   
   
   ### Behavior Change
   Writing a windowed aggregation result to an output topic without specifying 
an explicit key serde (e.g., `windowed.toStream().to("topic")` using only 
default serdes) previously threw a `ClassCastException` at the sink. It now 
succeeds and writes records using the standard windowed key format. A 
unit/integration test has been added to cover this scenario.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to