BigQuery: convert epoch to TIMESTAMP : <p>I'm trying to range-join two tables, like so</p>

<pre><code>SELECT *
FROM main_table h
INNER JOIN
    test.delay_pairs d
ON
    d.interval_start_time_utc &lt; h.visitStartTime
    AND h.visitStartTime &lt; d.interval_end_time_utc
</code></pre>

<p>where <code>h.visitStartTime</code> is an <code>INT64</code> epoch and <code>d.interval_start_time_utc</code> and <code>d.interval_end_time_utc</code> are proper <code>TIMESTAMP</code>s.</p>

<p>The above fails with</p>

<pre><code>No matching signature for operator &lt; for argument types: TIMESTAMP, INT64. Supported signature: ANY &lt; ANY
</code></pre>

<p>Neither wrapping <code>h.visitStartTime</code> in <code>TIMESTAMP()</code> nor <code>CAST(d.interval_start_time_utc AS INT64)</code> work. How do I make the two comparable in BigQuery's Standard SQL dialect?</p>
