General Information
SSD: ING-INF/05
CFU: 6
Professor: Paolo Garza
Teaching Assistant: Luca Colomba
Announcements
- 16-09-21: The first lecture is scheduled for September 27, 2021 at 16:00 in Classroom R1
- 23-09-21: No lab activities during the first two weeks of the course
- 27-09-21: I created a page for “01QYDOV – Big data: architectures and data analytics” on Piazza: piazza.com/polito.it/fall2021/01qydov
Piazza is a Q&A system that can be used to manage questions and answers offline. You can use it, instead of the email, when you have questions that are of interest also for other students (e.g., questions on the proposed solutions, problems with the configuration of the used software, etc.). There are different “channels” (lectures, lab, others) related to different topics. You can publish both public or private questions.
I will answer periodically to your questions (I will try to answer them daily). - 10-10-21: First lab activity this week
- Monday, October 11, 17:30 – 19:00 – LAIB1 – TEAM 1
- Wednesday, October 13, 14:30 – 16:00 – LAIB1 – TEAM 2
- 10-10-21: The lecture scheduled for Tuesday, October 12 at 10:00 will start at 11:30 and will last only 1.5 hours (from 11:30 to 13:00)
Teaching Material
- Introduction to the course content and exam rules (slides)
- Introduction to Big Data (slides)
- Big Data Architectures (slides)
- Hadoop and MapReduce
- Introduction to Apache Hadoop and the MapReduce programming paradigm (slides)
- Interaction with HDFS and Hadoop by means of 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) (slides without black background) (slides)
- MapReduce – Design patterns – Part 2 (slides)
- MapReduce – Relational Algebra/SQL operators (slides)
- Introduction to Apache Hadoop and the MapReduce programming paradigm (slides)
- Spark
- Introduction to Apache Spark (slides)
- How to submit Spark applications (slides)
- RDD-based programs RDDs
- Creation, basic transformations and actions (slides)
- 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)
- Textual data classification example code (zip)
- Classification and Parameter tuning (slides)
- Parameter tuning example code (zip)
- Clustering of structured data (slides)
- Clustering example code (zip)
- Itemset and Association rule mining (slides)
- Itemset and Association rule mining example code (zip)
- Linear regression (slides)
- Linear regression example code (zip)
- Spark Streaming (slides)
- Examples: Word Count – Streaming versions (zip)
- Introduction to Apache Spark (slides)
Exercise
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 Eclipse projects with libraries (those projects cannot be run locally but only on the cluster exporting the jar file of the project).
- MapReduce
- MapReduce exercises (slides)
- Solutions of Exercises 1-29 (SolutionsExMapReduce.zip)
- Basic project
- Linux and MacOs
- Basic Eclipse project for MapReduce applications (with libraries) (MapReduceBasicProjectWithLibraries.zip) – Import using Import/General/Existing Projects into Workspace
- Basic Eclipse project for MapReduce applications (based on maven) (MapReduceBasicProject.zip) – Import it using Import/Maven/Existing Maven Projects
- Windows
- Basic Eclipse project for MapReduce applications (with libraries) (MapReduceBasicProjectWithLibraries.zip) – Import using Import/General/Existing Projects into Workspace
- Setup instructions for running MapReduce applications locally inside Eclipse (ConfigureWindowsEnviroment.pdf)
- You must install also JDK 1.8 and select it for the imported project inside Eclipse. If you already installed the JDK environment but the version is greater than JDK 1.8 you must install also JDK 1.8.
- Winutils executable (winutils.zip)
- Basic Eclipse project for MapReduce applications (based on maven) (MapReduceBasicProjectWindows.zip)
- Linux and MacOs
- MapReduce exercises (slides)
- Spark
- 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) – Updated on November 19, 2021 – Added a second possibile solution for Exercise #44 (folder Exercise44 _v2)
- 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)
- Spark RDD-, Dataset-, DataFrame-based exercises (slides)
Laboratory Material
No lab activities during the first two weeks of the course
Team 1: Students from A to L – Monday from 17:30 to 19:00 – LAIB1
Team 2: Students from M to Z – Wednesday from 14:30 to 16:00 – LAIB1
- Lab1: Hadoop and MapReduce
- Problem specification (pdf)
- Basic project and small example data set (Lab1_BigData_with_libraries.zip)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux and macOS (Lab1.zip)
- Windows (Lab1Windows.zip)
- Bigger data set: finefoods_text.txt (zip)
- Import it using Import/Maven/Existing Maven Projects
- Solution Bonus track
- Lab1_SolBonusMvn.zip – The project is based on mvn
- Lab2: Filter with Hadoop MapReduce
- Problem specification (pdf)
- Skeleton Eclipse project Hadoop – MapReduce (Lab2_Skeleton_with_libraries.zip)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux and macOS (Lab2_Skeleton.zip)
- Windows (Lab2Windows_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Outputs of the first lab (OutputFolderLab1.zip) (OutputFolderLab1BonusTrack.zip). You can use them to test your application locally on your own PC if you are using Maven
- Solution
- Lab2_Sol.zip – The project is based on mvn
- Solution Bonus track
- Lab2_SolBonus.zip – The project is based on mvn
- Lab3: Frequently bought/reviewed together application with Hadoop MapReduce
- Problem specification (pdf)
- Skeleton Eclipse project Hadoop – MapReduce (Lab3_Skeleton_with_libraries.zip)
- Sample file (AmazonTransposedDataset_Sample.txt)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux and macOS (Lab3_Skeleton.zip)
- Windows (Lab3Windows_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Solution
- Lab3_Sol.zip – The project is based on mvn
- Comments on the three uploaded solutions (slides)
- Lab4: Normalized ratings for product recommendations with Hadoop MapReduce
- Problem specification (pdf)
- Skeleton Eclipse project Hadoop – MapReduce (Lab4_Skeleton_with_libraries.zip)
- Sample file (ReviewsSample.csv)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux and macOS (Lab4_Skeleton.zip)
- Windows (Lab4Windows_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Solution
- Lab4_Sol.zip – The project is based on mvn
- Lab5: Filter data and compute basic statistics with Apache Spark
- Problem specification (pdf)
- Skeleton Eclipse project Spark (Lab5_Skeleton_with_libraries.zip)
- Sample file (SampleLocalFile.csv)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux, macOS, Windows (Lab5_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Solution
- Lab6: Frequently bought/reviewed together application with Apache Spark
- Problem specification (pdf)
- Skeleton Eclipse project Spark (Lab6_Skeleton_with_libraries.zip)
- Sample file (ReviewsSample.csv)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux, macOS, Windows (Lab6_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Expected output – Task 1 (expected output if the input is the HDFS file Reviews.csv) (outputTask1Lab6.zip)
- Solution
- Lab7: Bike sharing data analysis
- Problem specification (pdf)
- Skeleton Eclipse project Spark (Lab7_Skeleton_with_libraries.zip)
- Sample data (sampleData.zip)
- Example KML file (exampleKML.zip)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux, macOS, Windows (Lab7_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Expected output
- Execution on sample data (sampleData/registerSample.csv and sampleData/stations.csv) and minimum criticality threshold = 0.4 (part-00000)
- Execution on complete data (/data/students/bigdata-01QYD/Lab7/register.csv and /data/students/bigdata-01QYD/Lab7/stations.csv) and minimum criticality threshold = 0.6 (part-00000)
- Solution
- Lab8: Bike sharing data analysis based on Spark SQL
- Problem specification (pdf)
- Skeleton Eclipse project – Spark (Lab8_Skeleton_with_libraries.zip)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux, macOS, Windows (Lab8_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Sample data (sampleData.zip)
- Solution
- Lab9: A classification pipeline with MLlib + SparkSQL
- Problem specification (pdf)
- Skeleton Eclipse project – Spark (Lab9_Skeleton_with_libraries.zip)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux, macOS, Windows (Lab9_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Sample file with 100 reviews (ReviewsSample.csv)
- Solution
- Lab10: Tweet analysis – Spark streaming
- Problem specification (pdf)
- Skeleton Eclipse project – Spark (Lab10_Skeleton_with_libraries.zip)
- Basic project based on Maven – Use this version of the project to run the MapReduce application locally on your own PC (DO NOT USE IT AT LAIB1)
- Import it using Import/Maven/Existing Maven Projects
- Linux, macOS, Windows (Lab10_Skeleton.zip)
- Import it using Import/Maven/Existing Maven Projects
- Example files – tweets (exampledata_tweets.zip)
- Solution
Exam examples
Pay attention that from the academic year 2020/21 the exam is closed book
- Spark Streaming – Examples of multiple choice questions (pdf)
- Answers
- Question 1: (c)
- Question 2: (d)
- Question 3: (b)
- Answers
- Exam June 30, 2017
- Exam July 14, 2017
- Exam September 14, 2017
- Exam June 26, 2018
- Exam July 16, 2018
- Exam September 3, 2018
- Exam February 15, 2019
- Exam July 2, 2019
- Exam July 18, 2019
- Exam July 2, 2020
- Exam July 16, 2020
- Exam September 17, 2020
- Exam February 5, 2021
- Exam June 30, 2021
- Exam February 2, 2022
- Exam February 21, 2022
- Exam July 4, 2022
- Exam September 6, 2022
- Exam (pdf)
- Draft of the solution
- Question 1: (c)
- Question 2: (d)
- Draft of the solution
- Exam (pdf)
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