Let us revise few of the important basics of Collections and APIs on top of collections. In case, you are newbie for Scala and want to learn it in detail, please go through this course.
Collections are broadly categorized into
- List – Collection of elements
- Set – Collection of unique elements
- Map – Collection of key value pairs
Based on the category of the collection, we will see different methods. For example
- List have methods to retrieve elements using index
- Set have methods related to set operations, such as union
- Map have methods related to keys and values, accessing values by passing keys and more.
Map Reduce APIs
We can use Map Reduce paradigm while processing data in collections
- Row level transformations – map
- Filtering data – filter
- Aggregating data – reduce, fold
- and many more