Skip to content

Commit

Permalink
Fix documentation for behavior of KTableKTable-Left-Join when Foreign…
Browse files Browse the repository at this point in the history
…KeyExtractor returns null.
  • Loading branch information
florin-akermann committed May 4, 2024
1 parent a727ef5 commit 6f8d61a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/streams/developer-guide/dsl-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,11 @@ <h4 class="anchor-heading"><a id="streams_concepts_globalktable" class="anchor-l
</li>
<li><p class="first">The join will be triggered under the conditions listed below whenever new input is received. When it is triggered, the user-supplied <code class="docutils literal"><span class="pre">ValueJoiner</span></code> will be called to produce
join output records.</p>
<blockquote>
<div><ul class="simple">
<li>Input records with a <code class="docutils literal"><span class="pre">null</span></code> value are ignored and do not trigger the join.</li>
</ul>
</div></blockquote>
</li>
<li><p class="first">For each input record on the left side that does not have any match on the right side, the <code class="docutils literal"><span class="pre">ValueJoiner</span></code> will be called with <code class="docutils literal"><span class="pre">ValueJoiner#apply(leftRecord.value,</span> <span class="pre">null)</span></code>;
this explains the row with timestamp=60 and timestampe=80 in the table below, which lists <code class="docutils literal"><span class="pre">[E,</span> <span class="pre">null]</span></code> and <code class="docutils literal"><span class="pre">[F,</span> <span class="pre">null]</span></code>in the LEFT JOIN column.
Expand Down Expand Up @@ -1947,6 +1952,11 @@ <h4 class="anchor-heading"><a id="streams_concepts_globalktable" class="anchor-l
</li>
<li><p class="first">The join will be triggered under the conditions listed below whenever new input is received. When it is triggered, the user-supplied <code class="docutils literal"><span class="pre">ValueJoiner</span></code> will be called to produce
join output records.</p>
<blockquote>
<div><ul class="simple">
<li>Input records with a <code class="docutils literal"><span class="pre">null</span></code> value are ignored and do not trigger the join.</li>
</ul>
</div></blockquote>
</li>
<li><p class="first">For each input record on one side that does not have any match on the other side, the <code class="docutils literal"><span class="pre">ValueJoiner</span></code> will be called with <code class="docutils literal"><span class="pre">ValueJoiner#apply(leftRecord.value,</span> <span class="pre">null)</span></code> or
<code class="docutils literal"><span class="pre">ValueJoiner#apply(null,</span> <span class="pre">rightRecord.value)</span></code>, respectively; this explains the row with timestamp=60, timestamp=80, and timestamp=100 in the table below, which lists <code class="docutils literal"><span class="pre">[E,</span> <span class="pre">null]</span></code>,
Expand Down Expand Up @@ -2532,6 +2542,10 @@ <h5><a class="toc-backref" href="#id34">KTable-KTable Foreign-Key
<blockquote>
<div>
<ul class="simple">
<li>
Records for which the <code class="docutils literal"><span class="pre">foreignKeyExtractor</span></code> produces <code class="docutils literal"><span class="pre">null</span></code> are ignored and do not trigger a join.
If you want to join with <code class="docutils literal"><span class="pre">null</span></code> foreign keys, use a suitable sentinel value to do so (i.e. <code class="docutils literal"><span class="pre">"NULL"</span></code> for a String field, or <code class="docutils literal"><span class="pre">-1</span></code> for an auto-incrementing integer field).
</li>
<li>Input records with a <code class="docutils
literal"><span class="pre">null</span></code>
value are interpreted as <em>tombstones</em>
Expand Down Expand Up @@ -2591,10 +2605,6 @@ <h5><a class="toc-backref" href="#id34">KTable-KTable Foreign-Key
<blockquote>
<div>
<ul class="simple">
<li>
Records for which the <code class="docutils literal"><span class="pre">foreignKeyExtractor</span></code> produces <code class="docutils literal"><span class="pre">null</span></code> are ignored and do not trigger a join.
If you want to join with <code class="docutils literal"><span class="pre">null</span></code> foreign keys, use a suitable sentinel value to do so (i.e. <code class="docutils literal"><span class="pre">"NULL"</span></code> for a String field, or <code class="docutils literal"><span class="pre">-1</span></code> for an auto-incrementing integer field).
</li>
<li>Input records with a <code class="docutils
literal"><span class="pre">null</span></code>
value are interpreted as <em>tombstones</em>
Expand Down

0 comments on commit 6f8d61a

Please sign in to comment.