Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-analytics-pipeline
Commits
64b2db0f
Unverified
Commit
64b2db0f
authored
May 15, 2018
by
Hassan
Committed by
GitHub
May 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #503 from edx/hassan/fix-user-location
Fix warehouse loading tasks.
parents
16780bdb
6f0ca841
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
edx/analytics/tasks/warehouse/load_internal_reporting_country.py
+2
-2
edx/analytics/tasks/warehouse/load_internal_reporting_user.py
+2
-2
No files found.
edx/analytics/tasks/warehouse/load_internal_reporting_country.py
View file @
64b2db0f
...
@@ -16,7 +16,7 @@ log = logging.getLogger(__name__)
...
@@ -16,7 +16,7 @@ log = logging.getLogger(__name__)
class
LoadInternalReportingCountryTableHive
(
LastCountryOfUserDownstreamMixin
,
HiveTableFromQueryTask
):
class
LoadInternalReportingCountryTableHive
(
LastCountryOfUserDownstreamMixin
,
HiveTableFromQueryTask
):
"""Loads internal_reporting_d_country Hive table from last_country_of_user Hive table."""
"""Loads internal_reporting_d_country Hive table from last_country_of_user
_id
Hive table."""
def
requires
(
self
):
def
requires
(
self
):
return
LastCountryOfUserPartitionTask
(
return
LastCountryOfUserPartitionTask
(
...
@@ -53,7 +53,7 @@ class LoadInternalReportingCountryTableHive(LastCountryOfUserDownstreamMixin, Hi
...
@@ -53,7 +53,7 @@ class LoadInternalReportingCountryTableHive(LastCountryOfUserDownstreamMixin, Hi
SELECT
SELECT
collect_set(lcu.country_name)[0]
collect_set(lcu.country_name)[0]
, lcu.country_code as user_last_location_country_code
, lcu.country_code as user_last_location_country_code
FROM last_country_of_user lcu
FROM last_country_of_user
_id
lcu
GROUP BY lcu.country_code
GROUP BY lcu.country_code
"""
"""
...
...
edx/analytics/tasks/warehouse/load_internal_reporting_user.py
View file @
64b2db0f
...
@@ -18,7 +18,7 @@ class AggregateInternalReportingUserTableHive(HiveTableFromQueryTask):
...
@@ -18,7 +18,7 @@ class AggregateInternalReportingUserTableHive(HiveTableFromQueryTask):
def
requires
(
self
):
def
requires
(
self
):
"""
"""
This task reads from auth_user, auth_user_profile, and last_country_of_user, so require that they be
This task reads from auth_user, auth_user_profile, and last_country_of_user
_id
, so require that they be
loaded into Hive (via MySQL loads into Hive or via the pipeline as needed).
loaded into Hive (via MySQL loads into Hive or via the pipeline as needed).
"""
"""
return
[
ImportAuthUserTask
(
overwrite
=
self
.
overwrite
,
destination
=
self
.
warehouse_path
),
return
[
ImportAuthUserTask
(
overwrite
=
self
.
overwrite
,
destination
=
self
.
warehouse_path
),
...
@@ -60,7 +60,7 @@ class AggregateInternalReportingUserTableHive(HiveTableFromQueryTask):
...
@@ -60,7 +60,7 @@ class AggregateInternalReportingUserTableHive(HiveTableFromQueryTask):
, COALESCE(lc.country_code, 'UNKNOWN')
, COALESCE(lc.country_code, 'UNKNOWN')
FROM auth_user au
FROM auth_user au
JOIN auth_userprofile aup ON au.id = aup.user_id
JOIN auth_userprofile aup ON au.id = aup.user_id
LEFT OUTER JOIN last_country_of_user
lc ON au.username = lc.username
LEFT OUTER JOIN last_country_of_user
_id lc ON au.id = lc.user_id
SORT BY au.username ASC
SORT BY au.username ASC
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment