title: Handle join of KStream with KTable when key is missing from KTable
body: <p>I recently started experimenting with kafka streams. I have a scenario where I need to join a <code>KStream</code> with a <code>KTable</code>. It may be the case that the <code>KTable</code> does not contain some of the keys. In that case I get a <code>NullPointerException</code>.</p>
  
  <p>specifically I was getting</p>
  
  <blockquote>
    <p>stream-thread [StreamThread-1] Streams application error during processing: 
    java.lang.NullPointerException</p>
  </blockquote>
  
  <p>I don't know how I can handle that. I cannot somehow filter out the records of the stream that do not correspond to a table entry.</p>
  
  <p><strong>update</strong></p>
  
  <p>Looking a bit further I found that I can query the underlying store to find whether a key exists through the <code>ReadOnlyKeyValueStore</code> interface. </p>
  
  <p>In this case my question is, would that be the best way to go? i.e. Filtering the stream to be joined based on whether a key exists in the local store? </p>
  
  <p>My second question in this case would be, since I care about leveraging the <code>Global State Store</code> introduced in version <code>10.2</code> in a next phase, should I expect that I will be also able in the same manner to query the <code>Global State Store</code>?</p>
  
  <p><strong>update</strong> </p>
  
  <p>The previous update is not accurate since it's not possible to query the state store from inside the topology</p>
  
  <p><strong>final update</strong></p>
  
  <p>After understanding the join semantics a bit better I was able to solve the issue just be simplifying the <code>valueJoiner</code> to only return the results, instead of performing actions on the joined values, and adding an extra filtering step after the join to filter out null values. </p>