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

Mohammad Yousuf Minhaj Zia commented on KAFKA-13641:
----------------------------------------------------

To be clear I do like the typing in Kafka streams. It is one of the better 
alternatives for what it does. Hope I didn't come across as rude or imply that 
I feel these are big flaws.

By type driven semantics, I mean making it absolutely clear about inputs in 
functions or function signatures themselves as to what is the accepted set of 
parameters or outputs or values of the parameters using types.

An example is that for keySerde in Materialized.with, we have an explicit type 
called KeySerde which sets the Serde isKey property to true for things like 
avro preventing users to have Materialized.with(serde (with is key = false), 
serde (with is key = true)).

Another example is obviously making Tombstones clear with the type system and 
using Either. Using Options for joins.

Yes types don't affect determinism. What I meant is that sometimes people incur 
non-deterministic behaviour by not being careful around something that could be 
enforced around the type system.

I would like to say `Functional Programming` but enforcing a paradigm is 
something that most people would be uncomfortable with although there are parts 
of it everywhere in the project.

> Kafka Streams Scala: Add `Option` to `ValueJoiner` parameters
> -------------------------------------------------------------
>
>                 Key: KAFKA-13641
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13641
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>            Reporter: Mohammad Yousuf Minhaj Zia
>            Priority: Minor
>
> Since `ValueJoiner` right parameter in `leftJoins`, `outerJoins` can be 
> nullable, I am wondering if can wrap them around Scala `Option`.
> However, there is also the concern that the left hand side value can be null 
> in the case of tombstone messages, in which the `Option` semantics can be 
> misleading. I still feel this could be a useful feature in reducing the 
> number of `NullPointerExceptions`.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to