Task: Data Warehouse Design and Implementation in Apache Hive
The objective of this task is to design and implement a sample data warehouse in Apache Hive, which
is described in the following narrative.
A university plans to create a data warehouse to store information about the submissions of student
assignments and later on to analyse the contents of a data warehouse. It is expected that the planned
data warehouse will contain historical information collected over a long period of time.
This data warehouse will contain information about assignment submissions (abbreviated as
“submissions” hereafter), assignments, subjects, students, and degrees.
The following relationships exist between the above domain entities: Each submission belongs to one
assignment and is submitted by one or more students (for individual or group submissions). Each
student is enrolled into one degree. Each assignment belongs to one subject.
A submission is described by a mark, a submission date, and a file path (which refers to a location on
An assignment is described by a weight (percentage), a due date and a specification file path.
A subject is described by a subject code and subject name.
A student is described by a student number, first name, last name, and email address. A student number
and email address separately identify each student.
The time dimension contains four levels: day, week, session (Autumn or Spring) and year.
This data warehouse should support OLAP queries, including the common aggregations about
submissions per subject, per student, per degree, per day, per week, per session, or per year.
You can make reasonable assumptions on the keys of domain entities.
Complete the following questions:
Part 1. Develop a conceptual model for the above data warehouse. The dimensions and hierarchies
must be correctly presented.
Part 2. Specify the OLAP operations for the following specific queries by using
relational algebraic notations (in the slides of Lectures 4 and 5):
(i) “Find the average slack period (i.e., number of days between submission date and due date) for
submissions per subject and per session”
(ii) “Find the average mark for each assignment for the subject ‘ISIT312-912’ in 2017” (Hint. Use
the “DICE” operation at page 46 of Lecture 4 slides.)
Part 3. Transform your conceptual model for Question 1 into a logical model with a star schema.
Note that all level tables in a star schema are flatten, i.e., denormalized.
part 4. Create an (internal or external) Hive table (schema) for each table in your logical model for
part 5. Populate the Hive tables for Question 4 with some sample data. More specifically, create a
file containing a few (e.g., three) sample records, which are determined by yourself, for each table in
the local system, and then load those files into Hive. Once done, use HQL to show all data.
Part 6. Implement the OLAP operations for Question 2 as HQL statements on the Hive tables for