Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P4700
T152650 Temporary Hive table for querying IP address, proxy, region and impressions in IE for mobile FR campaign
Active
Public
Actions
Authored by
AndyRussG
on Jan 4 2017, 3:06 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
MediaWiki-extensions-CentralNotice
Referenced Files
F5225505: T152650 Temporary Hive table for querying IP address, proxy, region and impressions in IE for mobile FR campaign
Jan 4 2017, 3:07 AM
2017-01-04 03:07:02 (UTC+0)
F5225502: T152650 Temporary Hive table for querying IP address, proxy, region and impressions in IE for mobile FR campaign
Jan 4 2017, 3:06 AM
2017-01-04 03:06:33 (UTC+0)
Subscribers
None
use
andyrussg
;
CREATE
TABLE
t152650ieipproxyimpratesbyregion20161218
AS
SELECT
nvl
(
ip_pr_pvs
.
subdivision
,
ip_pr_imps
.
subdivision
)
AS
subdivision
,
nvl
(
ip_pr_pvs
.
client_ip
,
ip_pr_imps
.
client_ip
)
AS
client_ip
,
nvl
(
ip_pr_pvs
.
proxy
,
ip_pr_imps
.
proxy
)
AS
proxy
,
nvl
(
ip_pr_pvs
.
ip_pr_pvs
,
0
)
AS
pageviews
,
nvl
(
ip_pr_imps
.
ip_pr_imps
,
0
)
AS
impressions
,
if
(
isnotnull
(
ip_pr_imps
.
ip_pr_imps
),
if
(
isnotnull
(
ip_pr_pvs
.
ip_pr_pvs
),
(
ip_pr_imps
.
ip_pr_imps
/
ip_pr_pvs
.
ip_pr_pvs
),
-
1
),
0
)
AS
imp_ratio
FROM
(
SELECT
count
(
*
)
AS
ip_pr_pvs
,
geocoded_data
[
'subdivision'
]
AS
subdivision
,
client_ip
,
x_analytics_map
[
'proxy'
]
AS
proxy
FROM
wmf
.
webrequest
WHERE
geocoded_data
[
'country_code'
]
=
'IE'
AND
access_method
=
'mobile web'
AND
is_pageview
=
TRUE
AND
agent_type
=
'user'
AND
pageview_info
[
'project'
]
=
'en.wikipedia'
AND
NOT
(
pageview_info
[
'page_title'
]
LIKE
"%Special:%"
)
AND
year
=
2016
AND
month
=
12
AND
day
=
18
GROUP
BY
geocoded_data
[
'subdivision'
],
client_ip
,
x_analytics_map
[
'proxy'
]
)
ip_pr_pvs
FULL
OUTER
JOIN
(
SELECT
count
(
*
)
AS
ip_pr_imps
,
geocoded_data
[
'subdivision'
]
AS
subdivision
,
client_ip
,
x_analytics_map
[
'proxy'
]
AS
proxy
FROM
andyrussg
.
beaconimpression20161218
WHERE
geocoded_data
[
'country_code'
]
=
'IE'
AND
access_method
=
'mobile web'
AND
normalized_host
.
project_class
=
'wikipedia'
AND
uselang
=
'en'
GROUP
BY
geocoded_data
[
'subdivision'
],
client_ip
,
x_analytics_map
[
'proxy'
]
)
ip_pr_imps
ON
ip_pr_imps
.
subdivision
=
ip_pr_pvs
.
subdivision
AND
ip_pr_imps
.
client_ip
=
ip_pr_pvs
.
client_ip
AND
ip_pr_imps
.
proxy
=
ip_pr_pvs
.
proxy
;
Event Timeline
AndyRussG
created this paste.
Jan 4 2017, 3:06 AM
2017-01-04 03:06:33 (UTC+0)
AndyRussG
edited the content of this paste.
(Show Details)
AndyRussG
mentioned this in
T152650: Spike: Impressions abnormally low for Ireland
.
Jan 4 2017, 3:36 AM
2017-01-04 03:36:41 (UTC+0)
Log In to Comment