title: Implementation of Streaming Join in Flink
body: <p>I am looking at the various implementations of join in Flink. In batch mode, I have come across the <code>hybrid-hash join</code> and <code>sort-merge join</code>. In both cases, there is a blocking shuffling that is done before the join and hence the output of the operators before join are materialized to some non-ephemeral storage as is said <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/dev/datastream/execution_mode/" rel="nofollow noreferrer">here</a>.</p>
  <p>I am now looking at the stream join case. I have seen an implementation where two hash tables are made for the two inputs. Whenever an input comes it is saved in its hash table and also probed against the other hash tables to produce results. To limit the hash table sizes, we put a window for which an input is saved in the hash table. My first question is:</p>
  <pre><code>Do all stream join cases have this requirement of a window?
  </code></pre>
  <p>Specifically, I want to discuss the implementation of the join where a large static <code>customers</code> table is joined with an <code>Orders</code> stream. In my opinion, the physical implementation should be something like this:</p>
  <p><a href="https://i.stack.imgur.com/GlikF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GlikF.jpg" alt="Hybrid hash join" /></a></p>
  <p>The <code>customers</code> table is first hash-partitioned. Then, the <code>orders</code> stream starts flowing in. As the execution mode is <code>streaming</code>, the <code>orders</code> table is directly sent to join tasks without any materialization.</p>
  <p>Does flink have such a join or can I implement this in Flink?</p>