Firebase Block - Derived Tables Issue

I am currently using the Firebase block available on Github.  When generating one of the predefined derived tables in the session view, I am getting a BigQuery resource error due to the use of Over and Order by.  Has anyone run into this and is there a solution?  Below is the query that is being used to create the derived table in the looker_scratch dataset.

Error message:  Resources exceeded during query execution: The query could not be executed in the allotted memory. Peak usage: 168% of limit.

SELECT unique_session_id,
      user_session_id,
       user_pseudo_id,
       MAX(TIMESTAMP_MICROS(event_timestamp)) as session_end,
       MIN(TIMESTAMP_MICROS(event_timestamp)) as session_start,
       (MAX(event_timestamp) - MIN(event_timestamp))/(60 * 1000 * 1000) AS session_length_minutes
  FROM (
SELECT user_pseudo_id,
       event_timestamp
      , SUM(is_new_session) OVER (ORDER BY user_pseudo_id, event_timestamp) AS unique_session_id,
       SUM(is_new_session) OVER (PARTITION BY user_pseudo_id ORDER BY event_timestamp) AS user_session_id
  FROM `xxx.looker_scratch.LR_STNXXX_last` as final
       ) session
 GROUP BY 1,2,3

0 0 56
0 REPLIES 0
Top Labels in this Space
Top Solution Authors