Nuria has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344055 )

Change subject: Adding renamed tables to sql union statements
......................................................................

Adding renamed tables to sql union statements

Code will be merged when rename is finished.

Please see:
https://phabricator.wikimedia.org/T160454

Bug: T160454
Change-Id: I4494e188ac054a4b1baefdb06c073343024f96d4
---
M flow/flow-replies-summary.sql
M flow/top-reply-link.sql
2 files changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/limn-flow-data 
refs/changes/55/344055/1

diff --git a/flow/flow-replies-summary.sql b/flow/flow-replies-summary.sql
index f90d06e..7cd80b7 100644
--- a/flow/flow-replies-summary.sql
+++ b/flow/flow-replies-summary.sql
@@ -6,8 +6,22 @@
        event_entrypoint,
        event_action,
        count(event_action)
+  FROM FlowReplies_10561344_15423246
+ WHERE wiki NOT IN ('testwiki', 'test2wiki', 'officewiki')
+   AND timestamp >= '{from_timestamp}'
+   AND timestamp < '{to_timestamp}'
+ GROUP BY event_entrypoint, event_action
+
+UNION ALL
+
+SELECT DATE('{from_timestamp}') as Date,
+       event_entrypoint,
+       event_action,
+       count(event_action)
   FROM FlowReplies_10561344
  WHERE wiki NOT IN ('testwiki', 'test2wiki', 'officewiki')
    AND timestamp >= '{from_timestamp}'
    AND timestamp < '{to_timestamp}'
  GROUP BY event_entrypoint, event_action;
+
+;
diff --git a/flow/top-reply-link.sql b/flow/top-reply-link.sql
index 7b1dd40..79cb9f4 100644
--- a/flow/top-reply-link.sql
+++ b/flow/top-reply-link.sql
@@ -7,9 +7,28 @@
        SUM(IF(event_entrypoint = 'reply-bottom' AND event_action = 'initiate', 
1, 0)) as "Bottom reply initiated",
        SUM(IF(event_entrypoint = 'reply-bottom' AND event_action = 
'save-attempt', 1, 0))  as "Bottom reply save attempt",
        SUM(IF(event_entrypoint = 'reply-bottom' AND event_action = 
'save-success', 1, 0))  as "Bottom reply save success"
+  FROM FlowReplies_10561344_15423246
+ WHERE event_entrypoint IN ('reply-top', 'reply-bottom')
+   AND event_action IN ('initiate', 'save-attempt', 'save-success')
+   AND wiki NOT IN ('testwiki', 'test2wiki', 'officewiki')
+   AND timestamp >= '{from_timestamp}'
+   AND timestamp < '{to_timestamp}'
+
+UNION ALL
+
+SELECT DATE('{from_timestamp}') as Date,
+       SUM(IF(event_entrypoint = 'reply-top' AND event_action = 'initiate', 1, 
0)) as "Top reply initiated",
+       SUM(IF(event_entrypoint = 'reply-top' AND event_action = 
'save-attempt', 1, 0)) as "Top reply save attempt",
+
+       SUM(IF(event_entrypoint = 'reply-top' AND event_action = 
'save-success', 1, 0))  as "Top reply save success",
+       SUM(IF(event_entrypoint = 'reply-bottom' AND event_action = 'initiate', 
1, 0)) as "Bottom reply initiated",
+       SUM(IF(event_entrypoint = 'reply-bottom' AND event_action = 
'save-attempt', 1, 0))  as "Bottom reply save attempt",
+       SUM(IF(event_entrypoint = 'reply-bottom' AND event_action = 
'save-success', 1, 0))  as "Bottom reply save success"
   FROM FlowReplies_10561344
  WHERE event_entrypoint IN ('reply-top', 'reply-bottom')
    AND event_action IN ('initiate', 'save-attempt', 'save-success')
    AND wiki NOT IN ('testwiki', 'test2wiki', 'officewiki')
    AND timestamp >= '{from_timestamp}'
    AND timestamp < '{to_timestamp}';
+
+;

-- 
To view, visit https://gerrit.wikimedia.org/r/344055
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4494e188ac054a4b1baefdb06c073343024f96d4
Gerrit-PatchSet: 1
Gerrit-Project: analytics/limn-flow-data
Gerrit-Branch: master
Gerrit-Owner: Nuria <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to