Created
March 1, 2013 18:17
-
-
Save alienrobotwizard/5066613 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw_student_activity = load '$INSTITUTION_PATH/student_activity/*' using civitas.analytics.pig_udf.PigStorageAvroSchema('$STUDENT_ACTIVITY_SCHEMA'); | |
raw_instructor_activity = load '$INSTITUTION_PATH/instructor_activity/*' using civitas.analytics.pig_udf.PigStorageAvroSchema('$INSTRUCTOR_ACTIVITY_SCHEMA'); | |
student_count_mappings = load '/tmp/umuc/student_activity_count_mappings.csv' using PigStorage(',') as (cnt_name:chararray, activity_type:chararray, activity_name:chararray); | |
instr_count_mappings = load '/tmp/umuc/instructor_activity_count_mappings.csv' using PigStorage(',') as (cnt_name:chararray, activity_type:chararray, activity_name:chararray); | |
student_event_log = foreach (join raw_student_activity by activity_name left outer, student_count_mappings by activity_type) generate | |
student_id, section_id, term_id, activity_pk, timestamp, | |
(student_count_mappings::activity_name is null ? raw_student_activity::activity_type : student_count_mappings::activity_name), | |
(student_count_mappings::activity_type is null ? raw_student_activity::activity_name : student_count_mappings::activity_type), | |
content_pk, has_group; | |
instr_event_log = foreach (join raw_instructor_activity by activity_name left outer, instr_count_mappings by activity_type) generate | |
instructor_hr_id, section_id, term_id, activity_pk, timestamp, | |
(instr_count_mappings::activity_name is null ? raw_instructor_activity::activity_type : instr_count_mappings::activity_name), | |
(instr_count_mappings::activity_type is null ? raw_instructor_activity::activity_name : instr_count_mappings::activity_type), | |
has_group; | |
store student_event_log into '/tmp/umuc/student_activity_all'; | |
store instr_event_log into '/tmp/umuc/instructor_activity_all'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment