Data enrichment is the act of adding more information to raw data. Some examples of the enrichments are as follows:
- Adding missing values
- Adding lookup values
- Joining with other datasets
- Filtering
- Aggregating
Continuing on the same example of using Person, let's say that the state element is optional. Given the zip information, we should be able to derive the value of state. In this specific case, we are performing the following two enrichments:
- Looking up or deriving the value of state based on the zip value
- Adding missing state value
Let's define a simple Scala function to map a US zip code to state. Please refer to Wikipedia (https://en.wikipedia.org/wiki/List_of_ZIP_code_prefixes) for more info on US ZIP codes:
- Define a Scala case class called Person with a method called cleanCopy to provide a clean copy of the object:
scala> case class Person...