title: LAG() and timestamps
body: <p>Possible BigQuery bug here? I'm running a query that uses the LAG() function to get the previous timesamp value. Example:</p>
  
  <p>schema:</p>
  
  <pre><code>id: STRING
  time: TIMESTAMP
  </code></pre>
  
  <p>query:</p>
  
  <pre><code>SELECT id, 
  time as current_time, LAG(time,1) OVER (PARTITION BY id, order by time) as previous_time
  FROM dataset.table
  </code></pre>
  
  <p>While "current_time" comes back as a timestamp value, "previous_time" comes back as an integer value. e.g.:</p>
  
  <pre><code>"12345", "2014-04-09 00:19:01 UTC", 1396992237000000
  </code></pre>
  
  <p>Any ideas on how to get LAG() return a TIMESTAMP?</p>