Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9517

KTable Joins Without Materialized Argument Yield Results That Further Joins NPE On

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.5.0, 2.4.1
    • Component/s: streams
    • Labels:
      None

      Description

      The `KTable` API implemented [[here||#L842-L844]] https://github.com/apache/kafka/blob/2.4.0/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableImpl.java#L842-L844 []|#L842-L844]] calls `doJoinOnForeignKey` with an argument of `Materialized.with(null, null)`, as apparently do several other APIs. As the comment spanning these lines] makes clear, the result is a `KTable` whose `valueSerde` (as a `KTableImpl`) is `null`. Therefore, attempts to `join` etc. on the resulting `KTable` fail with a `NullPointerException`.

      While there is an obvious workaround—explicitly construct the required `Materialized` and use the APIs that take it as an argument—I have to admit I find the existence of public APIs with this sort of bug, particularly when the bug is literally documented as a comment in the source code, astonishing to the point of incredulity. It calls the quality and trustworthiness of Kafka Streams into serious question, and if a resolution is not forthcoming within a week, we will be left with no other option but to consider technical alternatives.

        Attachments

        1. test.tar.xz
          546 kB
          Paul Snively

          Issue Links

            Activity

              People

              • Assignee:
                vvcephei John Roesler
                Reporter:
                psnively Paul Snively
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: