title: HiveQL - Using range filtering in exists checks results in error regarding correlated subquery
body: <p>So I want to achieve something like &quot;Check if there's any entry between two timestamp&quot; and all I can come up is some code like this:</p>
  <pre><code>CASE WHEN EXISTS(SELECT * FROM sometable WHERE sometable.timestamp between othertable.time1 and othertable.time2) THEN 1 ELSE 0 END
  </code></pre>
  <p>And then Hive is screaming this to me:</p>
  <pre><code>We can't transform correlated subquery having where correlated condition other than AND or in a non-equal expression.
  </code></pre>
  <p>Judging from the literal meaning of the error message, I'm thinking that when using columns from other tables (thus forming a correlated subquery), maybe you can't put any WHERE conditions with <code>&lt;</code> <code>&gt;</code> or <code>BETWEEN...AND...</code> with a SELECT clause inside an <code>EXISTS()</code>.</p>
  <p>So how can I do to achieve the thing I wanted?</p>