Skip to content

Commit

Permalink
refactor: delimiter "_" instead of "." in ids
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanBergenov committed Nov 4, 2024
1 parent 4f26e5d commit 7e68088
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions cf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ def get_temp_table_query(self):
SELECT
CONCAT(
stream_id,
".",
"_",
IFNULL(user_pseudo_id, ""),
".",
"_",
event_name,
".",
"_",
event_timestamp,
".",
"_",
IFNULL(CAST(batch_event_index AS STRING), ""),
".",
"_",
IFNULL(CAST(batch_page_id AS STRING), ""),
".",
"_",
IFNULL(CAST(batch_ordering_id AS STRING), ""),
".",
"_",
ROW_NUMBER() OVER (PARTITION BY CONCAT(
stream_id,
Expand All @@ -162,8 +162,8 @@ def get_events_query_select_statement(self):
qry = f"""SELECT
PARSE_DATE('%Y%m%d', event_date) AS event_date,
event_id,
CONCAT(user_pseudo_id, ".",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_id')) as session_id,
CONCAT(user_pseudo_id, ".",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_number')) as session_id_1,
CONCAT(user_pseudo_id, "_",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_id')) as session_id,
CONCAT(user_pseudo_id, "_",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_number')) as session_id_1,
event_timestamp AS event_timestamp,
event_name AS event_name,
Expand Down
4 changes: 2 additions & 2 deletions tests/rsc/sample_desired_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
PARSE_DATE('%%Y%%m%%d', event_date) AS event_date,
event_id,
CONCAT(user_pseudo_id, ".",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_id')) as session_id,
CONCAT(user_pseudo_id, ".",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_number')) as session_id_1,
CONCAT(user_pseudo_id, "_",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_id')) as session_id,
CONCAT(user_pseudo_id, "_",(SELECT value.int_value from UNNEST(event_params) WHERE key = 'ga_session_number')) as session_id_1,
event_timestamp AS event_timestamp,
event_name AS event_name,
Expand Down

0 comments on commit 7e68088

Please sign in to comment.