title: Drill: This query cannot be planned possibly due to either a cartesian join or an inequality join
body: <pre><code>SELECT *
  FROM hc
  LEFT OUTER JOIN n
  ON hc.JoinHack=n.JoinHack AND (n.`col1` IS NULL OR n.`col1`=hc.`col1`);
  </code></pre>
  
  <p>I am getting the error as in the question when running the above query in Drill. It seems Drill does not like the combination of an outer join and an OR in the condition. </p>
  
  <p>If I do inner join, the workaround of an equality check on a dummy column is enough to get rid of that error (<code>JoinHack</code> in my case). With outer join it is not enough.</p>
  
  <p>Running the below before the query also does not help:</p>
  
  <pre><code>alter session set `planner.enable_nljoin_for_scalar_only` = false;
  </code></pre>
  
  <p>What is the solution or a good workaround to this problem?</p>