General Information
SSD: ING-INF/05
CFU: 6
Professor: Daniele Apiletti
Teaching Assistant: Simone Monaco
Q&A teaching assistance on Piazza: piazza.com/polito.it/fall2023/01qydov
Announcements
- 20-09-23: The first lecture is scheduled for October 4, 2023, at 11:30 in Classroom 3P
- 27-09-23: No lab activities during the first weeks of the course. The lab will start in the upcoming weeks.
- 27-09-23: We are using Piazza for class discussion. We invite all students to join the course Piazza. Piazza is highly catered to getting help fast and efficiently from classmates and teachers. Rather than emailing questions to the teaching staff, students are invited to post their questions on Piazza.
Teaching Material
- Introduction to Apache Hadoop and the MapReduce programming paradigm (slides)
- Interaction with HDFS and Hadoop using the command line (slides)
- Hadoop implementation of MapReduce (slides)
- BigData@Polito environment + Jupyter – How to submit MapReduce jobs on BigData@Polito (slides)
- MapReduce and Hadoop – Advanced Topics: Multiple inputs, Multiple outputs, Distributed cache (slides)
- MapReduce – Design patterns – Part 1 (slides)
- MapReduce – Design patterns – Part 2 (slides)
- MapReduce – Relational Algebra/SQL operators (slides)
- Introduction to Apache Spark (slides)
- How to submit Spark applications (slides)
- RDD-based programs RDDs
- Spark SQL, Datasets and DataFrames (slides)
- Spark SQL – Join examples (ExamplesSparkSQLJoins.zip)
- Data Mining
- Recap data mining tasks (slides) – From the “Data Science And Database Technology” course
- Spark MLlib
- Introduction and Classification of structured data (slides)
- Classification of textual data (slides, example code zip)
- Classification and Parameter tuning (slides, example code zip)
- Clustering of structured data (slides, example code zip)
- Itemset and Association rule mining (slides, example code zip)
- Linear regression (slides, example code zip)
- Spark Streaming (slides)
- Examples: Word Count – Streaming versions (zip)
Exercises
If you use your PC to write and run your code, import the projects based on Maven (those projects can be run locally).
If you use the PC available in the LAB, import the projects with libraries (those projects cannot be run locally but only on the cluster exporting the project’s jar file). Refer to the Laboratory Material section for more information.
- MapReduce exercises (slides)
- Solutions of Exercises 1-29 (🗃️SolutionsExMapReduce.zip)
- Spark RDD-, Dataset-, DataFrame-based exercises (slides)
- Example data – One folder with (few) data for each exercise (🗃️ExampleDataSpark.zip)
- Solutions of Exercises 30-50 (🗃️SolutionsExSpark30-50.zip)
- Solutions of Exercises from 32 to 38 and 44 based on Spark SQL (🗃️SolSparkSQL32-38_44.zip)
- Spark streaming exercises (slides)
- Solutions of Exercises 51-53 (🗃️SolutionsSparkStreaming51_53.zip)
Laboratory Material
The first lab is scheduled for Friday, October 20
Student Group | Time | Room |
Team A: Students from A to L | Fri, 16:00-17:30 | Room 3D |
Team B: Students from M to Z | Fri, 17:30-19:00 | Room 3D |
We suggest the use of Visual Studio Code for the lab sessions. For the configuration instructions, refer to this 📘guide.
Windows users only: You must configure the winutils (🗃️winutils.zip) and set up some environmental variables. Follow this 📘extra guide for the complete configuration.
All the Laboratory materials are available in multiple versions. The version with libraries is the only one you can use on the Lab computers (without running locally). All the other versions are Maven projects, so you can use them locally on your laptop, depending on your OS and the cluster. The legend for the buttons is the following:
📚lib: with libraries, 🐧mavU: Maven project for Linux/MacOS, 🪟mavW: Maven project for Windows (Hadoop projects only)
Lab1: Hadoop and MapReduce
Problem specification (📄pdf)
Basic project and small example data set 📚lib, 🐧mavU, 🪟mavW)
Bigger data set: finefoods_text.txt (🗃️zip)
Solution (Bonus track 🐧mavU)
Lab2: Filter with Hadoop MapReduce
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU, 🪟mavW)
Outputs of the first lab (🗃️OutLab1.zip, 🗃️OutLab1Bonus.zip)
Lab3: Frequently bought/reviewed together application with Hadoop MapReduce
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU, 🪟mavW)
Sample file (📅AmazonTransposedDataset_Sample.txt)
Lab4: Normalized ratings for product recommendations with Hadoop MapReduce
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU, 🪟mavW)
Sample file (📅ReviewsSample.csv)
Solution (🐧mavU)
Lab5: Filter data and compute basic statistics with Apache Spark
Note: Windows users can download [icon name=”uniregistry” prefix=”fab”]mavU for all Spark projects.
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU)
Sample file (📅SampleLocalFile.csv)
Solution (🐧mavU)
Lab6: Frequently bought/reviewed together application with Apache Spark
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU)
Sample data (📅ReviewsSample.csv)
Expected output – Task 1 (expected output if the input is the HDFS file Reviews.csv) (🗃️outputTask1Lab6.zip)
Solution (🐧mavU)
Lab7: Bike sharing data analysis
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU)
Sample data (🗃️SampleData.zip)
Example KML file (🗃️exampleKML.zip)
Expected output
- On sample data (sampleData/{registerSample.csv,stations.csv}),min criticality threshold = 0.4 (part-00000)
- On complete data (/data/students/bigdata-01QYD/Lab7/{register.csv,stations.csv}), threshold = 0.6 (part-00000)
Solution (🐧mavU)
Lab8: Bike sharing data analysis based on Spark SQL
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU)
Sample data (🗃️SampleData.zip)
Solution (🐧mavU)
Lab9: A classification pipeline with MLlib + SparkSQL
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU)
Sample data (📅ReviewsSample.csv)
Solution. Logistic regression (🗃️zip)
Solution. DecisionTree (🗃️zip)
Solution. Logistic regression based on text analysis (🗃️zip)
Solution. DecisionTree based on text analysis (🗃️zip)
Lab10: Tweet analysis – Spark streaming
Problem specification (📄pdf)
Skeleton Project (📚lib, 🐧mavU)
Example files – tweets (🗃️exampledata_tweets.zip)
Solution (🐧mavU)
Exam examples
Pay attention that from the academic year 2022/23, the exam is open book.
Text | Solutions |
Spark Streaming – Examples of multiple choice questions (pdf) | Question 1: (c) Question 2: (d) Question 3: (b) |
Exam June 30, 2017 (pdf) | Question 1: (b) Question 2: (c) Source code/Eclipse projects (zip) |
Exam July 14, 2017 (pdf) | Question 1: (d) Question 2: (c) Source code/Eclipse projects (zip) |
Exam September 14, 2017 (pdf) | Question 1: (a) Question 2: (b) Source code/Eclipse projects (zip) |
Exam June 26, 2018 (pdf) | Question 1: (c) Question 2: (c) Source code/Eclipse projects (zip) |
Exam July 16, 2018 (pdf) | Question 1: (d) Question 2: (a) Source code/Eclipse projects (zip) |
Exam September 3, 2018 (pdf) | Question 1: (d) Question 2: (c) Source code/Eclipse projects (zip) |
Exam February 15, 2019 (pdf) | Question 1: (d) Question 2: (c) Source code/Eclipse projects (zip) |
Exam July 2, 2019 (pdf) | Question 1: (a) Question 2: (b) Source code/Eclipse projects (zip) |
Exam July 18, 2019 (pdf) | Question 1: (b) Question 2: (b) Source code/Eclipse projects (zip) |
Exam July 2, 2020 (pdf) | Question 1: (b) Question 2: (a) Source code/Eclipse projects (zip) |
Exam July 16, 2020 (pdf) | Question 1: (b) Question 2: (b) – Note that there are two actions and hence the input file is read two times. Source code/Eclipse projects (zip) |
Exam September 17, 2020 (pdf) | Question 1: (d) Question 2: (c) Source code/Eclipse projects (zip) |
Exam February 5, 2021 (pdf) | Question 1: (b) Question 2: (c) Source code/Eclipse projects (zip) |
Exam June 30, 2021Exam (pdf) | Question 1: (a) Question 2: (c) Source code/Eclipse projects (zip) |
Exam February 2, 2022 (pdf) | Question 1: (b) Question 2: (d) Source code/Eclipse projects (zip) |
Exam February 21, 2022 (pdf) | Question 1: (d) Question 2: (d) Source code/Eclipse projects (zip) |
Exam July 4, 2022 (pdf) | Question 1: (c) Question 2: (d) Source code/Eclipse projects (zip) |
Exam September 6, 2022 (pdf) | Question 1: (c) Question 2: (d) |
Additional material
- Slides and screencasts about Java (kindly provided by prof. Torchiano) (link)
- Suggested slides/lectures for those students who have never used Java
- OO Paradigm and UML (The UML part is not mandatory)
- The Java Environment
- Java Basic Features
- Java Inheritance
- Suggested slides/lectures for those students who have never used Java