From f7f097166f16ab626f0ee70272b3fc1f4de08ccf Mon Sep 17 00:00:00 2001 From: Roberto Agostino Vitillo Date: Fri, 19 Jun 2015 18:13:38 +0100 Subject: [PATCH] Combine os and osVersion filter options. --- mozaggregator/db.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mozaggregator/db.py b/mozaggregator/db.py index a5a1ee9..7e2bb12 100644 --- a/mozaggregator/db.py +++ b/mozaggregator/db.py @@ -252,9 +252,16 @@ begin into last_table_name using prefix, '_' || channel || '%'; - return query execute - E'select distinct dimensions->>\'' || filter || E'\' - from ' || last_table_name; + if (filter = 'os' or filter = 'osVersion') then + return query execute + E'select concat(t.os, \',\', t.version) + from (select distinct dimensions->>\'os\', dimensions->>\'osVersion\' + from ' || last_table_name || E') as t(os, version)'; + else + return query execute + E'select distinct dimensions->>\'' || filter || E'\' + from ' || last_table_name; + end if; end $$ language plpgsql strict stable;