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
"channel_id IN (SELECT id FROM channels WHERE creator = {})",
67
68
session.uid
68
69
));
69
70
}
70
71
71
72
where_clauses.push(format!(
72
-
"events->'{}'->'{}' IS NOT NULL",
73
-
query.event_type, query.metric
73
+
"event_type = '{}'",
74
+
query.event_type
75
+
));
76
+
77
+
where_clauses.push(format!(
78
+
"{} IS NOT NULL",
79
+
query.metric
74
80
));
75
81
76
82
format!(
77
-
"SUM(value::numeric)::varchar as value, (extract(epoch from created) - (MOD( CAST (extract(epoch from created) AS NUMERIC), {}))) as time from event_aggregates, jsonb_each_text(events->'{}'->'{}')",
78
-
interval,query.event_type, query.metric
83
+
"SUM({}::numeric)::varchar as value, (extract(epoch from created) - (MOD( CAST (extract(epoch from created) AS NUMERIC), {}))) as time from event_aggregates",
84
+
query.metric, interval
79
85
)
80
86
}
81
-
AnalyticsType::Global => {
87
+
AnalyticsType::Global=> {
82
88
where_clauses.push(format!(
83
-
"events->'{}'->'{}' IS NOT NULL",
84
-
query.event_type, query.metric
89
+
"event_type = '{}'",
90
+
query.event_type
85
91
));
92
+
93
+
where_clauses.push(format!(
94
+
"{} IS NOT NULL",
95
+
query.metric
96
+
));
97
+
98
+
where_clauses.push("earner IS NULL".to_string());
99
+
86
100
format!(
87
-
"SUM(value::numeric)::varchar as value, (extract(epoch from created) - (MOD( CAST (extract(epoch from created) AS NUMERIC), {}))) as time from event_aggregates, jsonb_each_text(events->'{}'->'{}')",
88
-
interval,query.event_type, query.metric
101
+
"SUM({}::numeric)::varchar as value, (extract(epoch from created) - (MOD( CAST (extract(epoch from created) AS NUMERIC), {}))) as time from event_aggregates",
"SUM((events->'{}'->'{}'->>'{}')::numeric) as value, (extract(epoch from created) - (MOD( CAST (extract(epoch from created) AS NUMERIC), {}))) as time from event_aggregates",
0 commit comments