title: How do I join this table in KSQL?
body: <p>I'm streaming a few tables from MS SQL Server into Kafka using CDC and the Debezium connector.  One of the SQL tables is represented in KSQL as a stream and the rest are KSQL tables that I want to join to the stream to enrich the data, so I have a chain of KSQL streams each joining a new KSQL table to the output of the previous KSQL stream in the chain.</p>
  
  <p>Let A be a KSQL stream.<br>
  Let B through D be KSQL tables.<br>
  A + B = A'<br>
  A' + C = A''<br>
  A'' + D = A'''   </p>
  
  <p>This works just fine for A' and A'', but A''' is giving me the error: <code>Source table (D) key column (X) is not the column used in the join criteria (Y).</code>  Why am I able to produce streams A' and A'' without incident but A''' gives me this error?</p>
  
  <p>I found some SO questions that indicated I should rekey D using the PARTITION BY clause, but that causes another error: <code>mismatched input 'PARTITION' expecting ';'</code>.  Seems like <code>CREATE TABLE</code> doesn't play nice with <code>PARTITION BY</code>, and if I use <code>CREATE STREAM</code> instead, it tells me I can't create a stream from a table and should use <code>CREATE TABLE</code>.</p>
  
  <p>HALP!</p>
  
  <p><strong>UPDATE:</strong> Obfuscated query added.</p>
  
  <pre><code>CREATE STREAM A_Enriched_Phase7
  WITH(PARTITIONS=1)
  AS
  SELECT *
  FROM A_Enriched_Phase6 a
      JOIN KsqlTableD d ON a.X = d.X
  PARTITION BY a.ID; 
  </code></pre>