[ https://issues.apache.org/jira/browse/KAFKA-12695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326191#comment-17326191 ]
Matthias J. Sax commented on KAFKA-12695: ----------------------------------------- Thanks for reporting this. Seems that there is a gap in picking up implicits correctly. However, your program seems not to be too useful atm anyway – note that `toTable` by default only changes the _interpretation of the data, but it won't really so any processing (and it also won't create a state store by default). A materialization might be done it the result `KTable` is used downstream, eg, in a join or aggregation. If you don't want to further process the result `KTable` but only want to write the data into a state store, you will need to pass in `Materialized` parameter, that would also allow you to specify `Serdes` (in case the bug also affects this case and implicits are not picked up correctly). > KStream.toTable must be extended to allow for a specific Serde > ---------------------------------------------------------------- > > Key: KAFKA-12695 > URL: https://issues.apache.org/jira/browse/KAFKA-12695 > Project: Kafka > Issue Type: Bug > Components: streams > Affects Versions: 2.7.0 > Reporter: Yura Nosenko > Priority: Minor > Labels: scala > > KStream.toTable seems to not be as useful as it can.`KStream.toTable` seems > to not be as useful as it can.I have a simple piece of code: > {{ builder.stream[String, String](post)}}{{.map(postExtractor)}}{{.toTable }} > > {{That fails with:}} > {{ Caused by: java.lang.ClassCastException: class java.lang.Long cannot > be cast to class [B (java.lang.Long and [B are in module java.base of loader > 'bootstrap')}} > But if I tweak it to: > > {{builder.stream[String, String](post).map(postExtractor).to("output-topic")}} > > It seems that toTable can only work with the default Serde configs. But if > it's the case it's of a limited use. > Especially in Scala code where all Produced/Consumed can be inferred as > implicit otherwise. -- This message was sent by Atlassian Jira (v8.3.4#803005)