Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CREATE OR REPLACE TABLE snowplow_web_base_sessions_lifecycle_manifest AS (SELECT * FROM (WITH new_events_session_ids_init AS (SELECT COALESCE(e.domain_sessionid, NULL) AS session_identifier, max(COALESCE(e.domain_userid, NULL)) AS user_identifier, min(collector_tstamp) AS start_tstamp, max(collector_tstamp) AS end_tstamp FROM embucket.datasets.events AS e WHERE dvce_sent_tstamp <= dateadd('day', 3, dvce_created_tstamp) AND collector_tstamp >= CAST('2022-08-19 00:00:00' AS TIMESTAMP) AND collector_tstamp <= CAST('2022-09-18 00:00:00' AS TIMESTAMP) AND true AND true GROUP BY 1), new_events_session_ids AS (SELECT * FROM new_events_session_ids_init AS e WHERE session_identifier IS NOT NULL AND NOT EXISTS (SELECT 1 FROM datasets.public_snowplow_manifest.snowplow_web_base_quarantined_sessions AS a WHERE a.session_identifier = e.session_identifier)), session_lifecycle AS (SELECT * FROM new_events_session_ids) SELECT sl.session_identifier, sl.user_identifier, sl.start_tstamp, least(dateadd('day', 3, sl.start_tstamp), sl.end_tstamp) AS end_tstamp FROM session_lifecycle AS sl) ORDER BY (to_date(start_tstamp)))table identifier should be fixed from
datasets.public_snowplow_manifest.snowplow_web_base_quarantined_sessions to embucket.datasets.public_snowplow_manifest.snowplow_web_base_quarantined_sessions