Finding word counts in a file using Spark

Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at the steps to find the word counts in a file using Spark 2.4.3. Input file:

Spark shell statements:

Output:

Happy Learning! Please leave a reply Read more

Match Expression in Scala

Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at a program to demonstrate the Match Expression in Scala. Match Expression is used to implement Java switch statement flow in Scala. Let’s look at the sample program:

Output: Read more

Sorting a List of custom objects using Ordered trait in Scala

Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at a Scala program to sort Employees objects based on their experience using Ordered trait.

Output: We have to implement compare function in Ordered trait to make a custom Read more

Sorting a List in Scala

Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at a Scala program to sort a List of items. The “sorted()” function will sort the list of items based on their natural ordering. Let’s look at the program:

Read more

Calculator program in Scala

Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at a Scala program to implement a Calculator operations. Let’s look at the program:

Output: We have created a Calculator class with 4 typical calculator methods +(addition), -(subtraction), *(multiplication) Read more