You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
description: "Sessions contain a combined view of tracks and pages from segment. Each session is a period of sustained activity, with a new session starting after a 30min+ period of inactivity. Each session contains a repeated field of records which are either tracks or pages. Common fields are extracted out into the top level and type specific fields are kept within two structs: records.track and records.page",
12
15
columns: {
13
16
session_id: "Unique identifier of the session",
@@ -18,7 +21,7 @@ module.exports = (params) => {
18
21
...params.defaultConfig
19
22
}).query(ctx=>`
20
23
21
-
/* TODO: optimise this code to make it work, or enable only for incremental builds
24
+
/* TODO: optimise this code to make it work, or enable only for incremental builds */
22
25
with first_and_last_page_values as (
23
26
select distinct
24
27
session_id,
@@ -29,6 +32,7 @@ select distinct
29
32
ignore_nulls: true,
30
33
partition_fields: "session_id",
31
34
order_fields: 'sessionized_pages.timestamp asc',
35
+
frame_clause: "rows between unbounded preceding and unbounded following",
Copy file name to clipboardExpand all lines: includes/users.js
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,9 @@ let USER = `coalesce(
8
8
9
9
module.exports=(params)=>{
10
10
returnpublish("segment_users",{
11
+
assertions: {
12
+
uniqueKey: ["user_id"]
13
+
},
11
14
description: "Users aggregates all identifies calls to give a table with one row per user_id. Identify calls without only an anonymous_id are mapped to the user where possible.",
12
15
columns: {
13
16
user_id: "Unique identifier of the user",
@@ -24,14 +27,16 @@ select distinct
24
27
ignore_nulls: true,
25
28
partition_fields: USER,
26
29
order_fields: "identifies.timestamp asc",
30
+
frame_clause: "rows between unbounded preceding and unbounded following",
0 commit comments