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

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: I4fd36f394f011f38c38230607ea6e936fa5c3e91
---
M interactive/events-all.sql
M interactive/events.sql
2 files changed, 33 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats 
refs/changes/49/344049/1

diff --git a/interactive/events-all.sql b/interactive/events-all.sql
index 83be802..aaea9a3 100644
--- a/interactive/events-all.sql
+++ b/interactive/events-all.sql
@@ -16,10 +16,21 @@
         event_action AS action,
         event_feature AS feature,
         SUM(event_sampling) AS events
-    FROM Kartographer_16132745
+    FROM Kartographer_16132745_15423246
     WHERE
         timestamp >= '{from_timestamp}'
         AND timestamp < '{to_timestamp}'
     GROUP BY event_action, event_feature
 
+UNION ALL
+
+        DATE(timestamp) AS day,
+        event_action AS action,
+        event_feature AS feature,
+        SUM(event_sampling) AS events
+    FROM Kartographer_16132745
+    WHERE
+        timestamp >= '{from_timestamp}'
+        AND timestamp < '{to_timestamp}'
+    GROUP BY event_action, event_feature
 ;
diff --git a/interactive/events.sql b/interactive/events.sql
index 1eeb699..febe2d9 100644
--- a/interactive/events.sql
+++ b/interactive/events.sql
@@ -24,6 +24,27 @@
         event_action AS action,
         event_feature AS feature,
         SUM(event_sampling) AS events
+    FROM Kartographer_16132745_15423246, metawiki.sites
+    WHERE
+        wiki = site_global_key
+        AND (
+            '{family}' = 'all'
+            -- Non-special wikis
+            OR site_group = '{family}'
+            -- site_group for 'metawiki' is 'meta', etc
+            OR ( '{family}' = 'special' AND INSTR(wiki, site_group) = 0 )
+        )
+        AND timestamp >= '{from_timestamp}'
+        AND timestamp < '{to_timestamp}'
+    GROUP BY event_action, event_feature
+
+UNION ALL
+
+SELECT
+        DATE(timestamp) AS day,
+        event_action AS action,
+        event_feature AS feature,
+        SUM(event_sampling) AS events
     FROM Kartographer_16132745, metawiki.sites
     WHERE
         wiki = site_global_key

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fd36f394f011f38c38230607ea6e936fa5c3e91
Gerrit-PatchSet: 1
Gerrit-Project: analytics/discovery-stats
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