From d90284558a7f9a9891420fcc53a045dc2ab7dff4 Mon Sep 17 00:00:00 2001 From: Andres Gregori Altamirano Date: Fri, 12 Jul 2024 18:27:30 +0000 Subject: [PATCH] change input --- views/bqml/arima_event_model/training_input_arima.view.lkml | 2 +- views/bqml/avbb/training_data_avbb.view.lkml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/views/bqml/arima_event_model/training_input_arima.view.lkml b/views/bqml/arima_event_model/training_input_arima.view.lkml index ccf1a65..45f51ed 100644 --- a/views/bqml/arima_event_model/training_input_arima.view.lkml +++ b/views/bqml/arima_event_model/training_input_arima.view.lkml @@ -7,7 +7,7 @@ view: training_input_arima { events.event_name AS events_event_name, COUNT(DISTINCT sessions.sl_key ) AS sum_of_session_event_count FROM ${sessions.SQL_TABLE_NAME} AS sessions -LEFT JOIN sessions.event_data as events with offset as event_row +LEFT JOIN UNNEST(sessions.event_data) as events with offset as event_row WHERE ((( TIMESTAMP_MICROS(events.event_timestamp) ) >= ((TIMESTAMP_ADD(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL -89 DAY))) AND ( TIMESTAMP_MICROS(events.event_timestamp) ) < ((TIMESTAMP_ADD(TIMESTAMP_ADD(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL -89 DAY), INTERVAL 90 DAY))))) GROUP BY 1,2 ORDER BY 1 DESC;; } diff --git a/views/bqml/avbb/training_data_avbb.view.lkml b/views/bqml/avbb/training_data_avbb.view.lkml index 951ff1d..158972a 100644 --- a/views/bqml/avbb/training_data_avbb.view.lkml +++ b/views/bqml/avbb/training_data_avbb.view.lkml @@ -15,7 +15,7 @@ view: training_data_avbb { SUM(session_data.session_page_view_count) as session_count, COALESCE(SUM(event_data[SAFE_OFFSET(0)].user_ltv.revenue),0.0) as label FROM ${sessions.SQL_TABLE_NAME} as sessions - LEFT JOIN sessions.event_data as events with offset as event_row GROUP BY 1,2,3,4,5,6,7;; + LEFT JOIN UNNEST(sessions.event_data) as events with offset as event_row GROUP BY 1,2,3,4,5,6,7;; } dimension: sl_key { hidden: yes