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

How to add a new column and update its value based on the other column in the Dataframe in Spark

Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at updating a column value based on another column value in a dataframe using when() utility function in Spark.

  WHEN() function documentation: static Column when(Column condition, Object value) Evaluates a list Read more