title: org.apache.spark.sql.AnalysisException: Reference 'dattim' is ambiguous, could be: dattim#6, event_dattim#55.;
body: <p>I have a joined dataframes with a where clause that the dataStampe is within a range:</p>
  
  <pre><code>val startTime = new 
  Timestamp(NewDate.atStartOfDay.toEpochSecond(ZoneOffset.UTC) * 1000)
  val endTime = new 
  Timestamp(NewDate.plusDays(1).atStartOfDay.toEpochSecond(ZoneOffset.UTC) * 
  1000)
  
  val joinedTable = table1.join(table2,
  table1("date") === table1("key")
  &amp;&amp; ....).where(table1("dattim") &gt;= startTimestamp &amp;&amp; table1("dattim") &lt; endTimestamp)
  </code></pre>
  
  <p>it complains that Reference 'dattim' is ambiguous, I tried to use 
  range:</p>
  
  <pre><code>table1("tattim") === (startTime to endTime) 
  </code></pre>
  
  <p>it still not taking it.
  any suggestions?</p>