Explore Courses
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Birla Institute of Management Technology Birla Institute of Management Technology Post Graduate Diploma in Management (BIMTECH)
  • 24 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Popular
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science & AI (Executive)
  • 12 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
University of MarylandIIIT BangalorePost Graduate Certificate in Data Science & AI (Executive)
  • 8-8.5 Months
upGradupGradData Science Bootcamp with AI
  • 6 months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
OP Jindal Global UniversityOP Jindal Global UniversityMaster of Design in User Experience Design
  • 12 Months
Popular
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Rushford, GenevaRushford Business SchoolDBA Doctorate in Technology (Computer Science)
  • 36 Months
IIIT BangaloreIIIT BangaloreCloud Computing and DevOps Program (Executive)
  • 8 Months
New
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Popular
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
Golden Gate University Golden Gate University Doctor of Business Administration in Digital Leadership
  • 36 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
Popular
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
Bestseller
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
IIIT BangaloreIIIT BangalorePost Graduate Certificate in Machine Learning & Deep Learning (Executive)
  • 8 Months
Bestseller
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in AI and Emerging Technologies (Blended Learning Program)
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
ESGCI, ParisESGCI, ParisDoctorate of Business Administration (DBA) from ESGCI, Paris
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration From Golden Gate University, San Francisco
  • 36 Months
Rushford Business SchoolRushford Business SchoolDoctor of Business Administration from Rushford Business School, Switzerland)
  • 36 Months
Edgewood CollegeEdgewood CollegeDoctorate of Business Administration from Edgewood College
  • 24 Months
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with Concentration in Generative AI
  • 36 Months
Golden Gate University Golden Gate University DBA in Digital Leadership from Golden Gate University, San Francisco
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Deakin Business School and Institute of Management Technology, GhaziabadDeakin Business School and IMT, GhaziabadMBA (Master of Business Administration)
  • 12 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science (Executive)
  • 12 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityO.P.Jindal Global University
  • 12 Months
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (AI/ML)
  • 36 Months
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDBA Specialisation in AI & ML
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
New
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGrad KnowledgeHutupGrad KnowledgeHutAzure Administrator Certification (AZ-104)
  • 24 Hours
KnowledgeHut upGradKnowledgeHut upGradAWS Cloud Practioner Essentials Certification
  • 1 Week
KnowledgeHut upGradKnowledgeHut upGradAzure Data Engineering Training (DP-203)
  • 1 Week
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
Loyola Institute of Business Administration (LIBA)Loyola Institute of Business Administration (LIBA)Executive PG Programme in Human Resource Management
  • 11 Months
Popular
Goa Institute of ManagementGoa Institute of ManagementExecutive PG Program in Healthcare Management
  • 11 Months
IMT GhaziabadIMT GhaziabadAdvanced General Management Program
  • 11 Months
Golden Gate UniversityGolden Gate UniversityProfessional Certificate in Global Business Management
  • 6-8 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
IU, GermanyIU, GermanyMaster of Business Administration (90 ECTS)
  • 18 Months
Bestseller
IU, GermanyIU, GermanyMaster in International Management (120 ECTS)
  • 24 Months
Popular
IU, GermanyIU, GermanyB.Sc. Computer Science (180 ECTS)
  • 36 Months
Clark UniversityClark UniversityMaster of Business Administration
  • 23 Months
New
Golden Gate UniversityGolden Gate UniversityMaster of Business Administration
  • 20 Months
Clark University, USClark University, USMS in Project Management
  • 20 Months
New
Edgewood CollegeEdgewood CollegeMaster of Business Administration
  • 23 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
KnowledgeHut upGradKnowledgeHut upGradBackend Development Bootcamp
  • Self-Paced
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 5 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
upGradupGradDigital Marketing Accelerator Program
  • 05 Months

6 Game Changing Features of Apache Spark [How Should You Use]

Updated on 22 November, 2022

1.3K+ views
10 min read

Ever since Big Data took the tech and business worlds by storm, there’s been an enormous upsurge of Big Data tools and platforms, particularly of Apache Hadoop and Apache Spark. Today, we’re going to focus solely on Apache Spark and discuss at length about its business benefits and applications. 

Apache Spark came to the limelight in 2009, and ever since, it has gradually carved out a niche for itself in the industry. According to Apache org., Spark is a “lightning-fast unified analytics engine” designed for processing colossal amounts of Big Data. Thanks to an active community, today, Spark is one of the largest open-source Big Data platforms in the world.  

Check out our free courses to get an edge over the competition.

What is Apache Spark?

Originally developed in the University of California’s (Berkeley) AMPLab, Spark was designed as a robust processing engine for Hadoop data, with a special focus on speed and ease of use. It is an open-source alternative to Hadoop’s MapReduce. Essentially, Spark is a parallel data processing framework that can collaborate with Apache Hadoop to facilitate the smooth and fast development of sophisticated Big Data applications on Hadoop

Spark comes packed with a wide range of libraries for Machine Learning (ML) algorithms and graph algorithms. Not just that, it also supports real-time streaming and SQL apps via Spark Streaming and Shark, respectively. The best part about using Spark is that you can write Spark apps in Java, Scala, or even Python, and these apps will run nearly ten times faster (on disk) and 100 times faster (in memory) than MapReduce apps.

Apache Spark is quite versatile as it can be deployed in many ways, and it also offers native bindings for Java, Scala, Python, and R programming languages. It supports SQL, graph processing, data streaming, and Machine Learning. This is why Spark is widely used across various sectors of the industry, including banks, telecommunication companies, game development firms, government agencies, and of course, in all the top companies of the tech world – Apple, Facebook, IBM, and Microsoft.

6 Best Features of Apache Spark

The features that make Spark one of the most extensively used Big Data platforms are:

1. Lighting-fast processing speed

Big Data processing is all about processing large volumes of complex data. Hence, when it comes to Big Data processing, organizations and enterprises want such frameworks that can process massive amounts of data at high speed. As we mentioned earlier, Spark apps can run up to 100x faster in memory and 10x faster on disk in Hadoop clusters.

It relies on Resilient Distributed Dataset (RDD) that allows Spark to transparently store data on memory and read/write it to disc only if needed. This helps to reduce most of the disc read and write time during data processing.

2. Ease of use

Spark allows you to write scalable applications in Java, Scala, Python, and R. So, developers get the scope to create and run Spark applications in their preferred programming languages. Moreover, Spark is equipped with a built-in set of over 80 high-level operators. You can use Spark interactively to query data from Scala, Python, R, and SQL shells.

3. It offers support for sophisticated analytics

Not only does Spark support simple “map” and “reduce” operations, but it also supports SQL queries, streaming data, and advanced analytics, including ML and graph algorithms. It comes with a powerful stack of libraries such as SQL & DataFrames and MLlib (for ML), GraphX, and Spark Streaming. What’s fascinating is that Spark lets you combine the capabilities of all these libraries within a single workflow/application.

4. Real-time stream processing

Spark is designed to handle real-time data streaming. While MapReduce is built to handle and process the data that is already stored in Hadoop clusters, Spark can do both and also manipulate data in real-time via Spark Streaming.

Unlike other streaming solutions, Spark Streaming can recover the lost work and deliver the exact semantics out-of-the-box without requiring extra code or configuration. Plus, it also lets you reuse the same code for batch and stream processing and even for joining streaming data to historical data.

5. It is flexible

Spark can run independently in cluster mode, and it can also run on Hadoop YARN, Apache Mesos, Kubernetes, and even in the cloud. Furthermore, it can access diverse data sources. For instance, Spark can run on the YARN cluster manager and read any existing Hadoop data. It can read from any Hadoop data sources like HBase, HDFS, Hive, and Cassandra. This aspect of Spark makes it an ideal tool for migrating pure Hadoop applications, provided the apps’ use-case is Spark-friendly.

6. Active and expanding community

Developers from over 300 companies have contributed to design and build Apache Spark. Ever since 2009, more than 1200 developers have actively contributed to making Spark what it is today! Naturally, Spark is backed by an active community of developers who work to improve its features and performance continually. To reach out to the Spark community, you can make use of mailing lists for any queries, and you can also attend Spark meetup groups and conferences.

The anatomy of Spark Applications

Every Spark application comprises of two core processes – a primary driver process and a collection of executor processes. 

Source 

The driver process that sits on a node in the cluster is responsible for running the main() function. It also handles three other tasks – maintaining information about the Spark Application, responding to a user’s code or input, and analyzing, distributing, and scheduling work across the executors. The driver process forms the heart of a Spark Application – it contains and maintains all critical information covering the lifetime of the Spark application.

The executors or executor processes are secondary items that must execute the task assigned to them by the driver. Basically, each executor performs two crucial functions – run the code assigned to it by the driver and report the state of the computation (on that executor) to the driver node. Users can decide and configure how many executors each node should have.

In a Spark application, the cluster manager controls all machines and allocates resources to the application. Here, the cluster manager can be any one of Spark’s core cluster managers, including YARN (Spark’s standalone cluster manager) or Mesos. This entails that a cluster can run multiple Spark Applications simultaneously.

Real-world Apache Spark Applications 

Spark is a top-rated and widely used Big Dara platform in the modern industry. Some of the most acclaimed real-world examples of Apache Spark applications are:

Spark for Machine Learning

Apache Spark boasts of a scalable Machine Learning library – MLlib. This library is explicitly designed for simplicity, scalability, and facilitating seamless integration with other tools. MLlib not only possesses the scalability, language compatibility, and speed of Spark, but it can also perform a host of advanced analytics tasks like classification, clustering, dimensionality reduction. Thanks to MLlib, Spark can be used for predictive analysis, sentiment analysis, customer segmentation, and predictive intelligence.

Another impressive feature of Apache Spark rests in the network security domain. Spark Streaming allows users to monitor data packets in real time before pushing them to storage. During this process, it can successfully identify any suspicious or malicious activities that arise from known sources of threat. Even after the data packets are sent to the storage, Spark uses MLlib to analyze the data further and identify potential risks to the network. This feature can also be used for fraud and event detection. 

Spark for Fog Computing

Apache Spark is an excellent tool for fog computing, particularly when it concerns the Internet of Things (IoT). The IoT heavily relies on the concept of large-scale parallel processing. Since the IoT network is made of thousands and millions of connected devices, the data generated by this network each second is beyond comprehension.

Naturally, to process such large volumes of data produced by IoT devices, you require a scalable platform that supports parallel processing. And what better than Spark’s robust architecture and fog computing capabilities to handle such vast amounts of data!

Fog computing decentralizes the data and storage, and instead of using cloud processing, it performs the data processing function on the edge of the network (mainly embedded in the IoT devices).

To do this, fog computing requires three capabilities, namely, low latency, parallel processing of ML, and complex graph analytics algorithms – each of which is present in Spark. Furthermore, the presence of Spark Streaming, Shark (an interactive query tool that can function in real-time), MLlib, and GraphX (a graph analytics engine) further enhances Spark’s fog computing ability. 

Spark for Interactive Analysis

Unlike MapReduce, or Hive, or Pig, that have relatively low processing speed, Spark can boast of high-speed interactive analytics. It is capable of handling exploratory queries without requiring sampling of the data. Also, Spark is compatible with almost all the popular development languages, including R, Python, SQL, Java, and Scala.

The latest version of Spark – Spark 2.0 – features a new functionality known as Structured Streaming. With this feature, users can run structured and interactive queries against streaming data in real-time.

Check our other Software Engineering Courses at upGrad.

Users of Spark

Now that you are well aware of the features and abilities of Spark, let’s talk about the four prominent users of Spark!

1. Yahoo

Yahoo uses Spark for two of its projects, one for personalizing news pages for visitors and the other for running analytics for advertising. To customize news pages, Yahoo makes use of advanced ML algorithms running on Spark to understand the interests, preferences, and needs of individual users and categorize the stories accordingly.

For the second use case, Yahoo leverages Hive on Spark’s interactive capability (to integrate with any tool that plugs into Hive) to view and query the advertising analytic data of Yahoo gathered on Hadoop. 

2. Uber 

Uber uses Spark Streaming in combination with Kafka and HDFS to ETL (extract, transform, and load) vast amounts of real-time data of discrete events into structured and usable data for further analysis. This data helps Uber to devise improved solutions for the customers.

3. Conviva

As a video streaming company, Conviva obtains an average of over 4 million video feeds each month, which leads to massive customer churn. This challenge is further aggravated by the problem of managing live video traffic. To combat these challenges effectively, Conviva uses Spark Streaming to learn network conditions in real-time and to optimize its video traffic accordingly. This allows Conviva to provide a consistent and high-quality viewing experience to the users.

4. Pinterest

On Pinterest, users can pin their favourite topics as and when they please while surfing the Web and social media. To offer a personalized and enhanced customer experience, Pinterest makes use of Spark’s ETL capabilities to identify the unique needs and interests of individual users and provide relevant recommendations to them on Pinterest.

Conclusion

To conclude, Spark is an extremely versatile Big Data platform with features that are built to impress. Since it an open-source framework, it is continuously improving and evolving, with new features and functionalities being added to it. As the applications of Big Data become more diverse and expansive, so will the use cases of Apache Spark.

If you are interested to know more about Big Data, check out our Advanced Certificate Programme in Big Data from IIIT Bangalore.

Frequently Asked Questions (FAQs)

1. What is the average salary of a Big Data Engineer in India?

The Big Data field is growing at a faster rate. More and more companies are now getting to understand the benefits of using data effectively and using the derived insights to gain more customers and enhance revenue. In fact, the Big Data domain is expected to grow at a CAGR of 12.97% from 2020 to 2025. Hence, the demand for specialised professionals in the field is also increasing continuously. Many job opportunities are created, such as Data Analyst, Database Manager, and Big Data Engineer. The Big Data Engineer is entrusted with the responsibility of managing the data pipeline, designing the architecture of the Big Data platform, etc. They are paid a handsome salary for the tasks they undertake. The average salary of a Data Engineer in India is approximately INR 8.1 LPA.

2. What is the difference between a Data Scientist and a Machine Learning Engineer?

The process of deriving insights from raw data involves a lot of intermediaries. The difficult task is conducted by a group of specialised individuals with expertise in different field domains. Two of the experts in the field are Data Scientists and Machine Learning Engineers. The main task of a Data Scientist is to analyse the data and gain valuable insights from it. In contrast, Machine Learning Engineers write codes and focus on deploying machine learning products. They scale the theoretical data science models to production level models.

3. What is the MapReduce programming Model?

The massive amount of generated data has to be processed fast and efficiently. This is where MapReduce comes into the picture. It can be referred to as a processing technique or a programming model used to access the Big Data stored in the Hadoop File System (HDFS). The main task of MapReduce is to break the data into smaller chunks and process them in different Hadoop servers, and finally aggregate all data into a consolidated output in the end.