[ 
https://issues.apache.org/jira/browse/KAFKA-7714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713305#comment-16713305
 ] 

John Roesler commented on KAFKA-7714:
-------------------------------------

Hi [~ccrain_kuka],

Thanks for your interest in improving the API!

I actually kicked around the idea of proposing a similar change for the Java 
API, partly for the same reason that Scala introduced `Option`, and partly 
because it gets us out of a semantic trap regarding the interpretation of 
records with `null` values.

It will probably be a minefield, but I wonder if we should at least consider 
making the change in both the Java and Scala APIs...

 

To answer your question about breaking changes... We try really hard to avoid 
it.

We've learned that sometimes, the syntax of Scala makes it impossible to make 
some changes without breaking source compatibility (notably implicits), but I 
think the change you're proposing would be possible to do "safely".

I think we'd introduce a new method with a default implementation calling back 
to the old method, and then mark the old method deprecated. To avoid forcing 
people to implement the deprecated method, we can also add a default 
implementation to it that throws an exception. It's a bummer, because the 
interface doesn't advertise that you have to implement a method, though, so I'm 
open to suggestions...

 

To actually propose a change, you have to go through the KIP process. I'm happy 
to help guide you through the process if you'd like.

-John

> Scala streams API should use Options in left and outer joins
> ------------------------------------------------------------
>
>                 Key: KAFKA-7714
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7714
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>    Affects Versions: 2.0.1, 2.1.0
>            Reporter: Charles Crain
>            Priority: Minor
>
> The Scala streams DSL for left and outer joins should use Options instead of 
> possibly-null parameters to the joiner functions. As currently written, 
> implementers of joiners for Kafka Streams must account for the right side of 
> a left join (or either side of an outer join) being null, which is not 
> idiomatic Scala.
> Note to reviewer: I would like to contribute this change myself. What is the 
> policy on breaking API changes? Would it be acceptable to change the 
> left/outer join APIs to accept options? Or would I need to implement parallel 
> versions (naming suggestions if so?).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to