I have done C/Java/C3/Python/JS
all my life. Since yesterday I am looking at some scala code, now i m super confused about everything..
The snippet goes:
// Parse the input file
val lines = fromTextFile(input)
// Iterate on every element to generate the keys, and then aggregate it
val counts = lines.mapFlatten{
line =>
val rowSplit = line.split(",",-1)
.... }
the signature of the method mapFlatten in scoobi api is :
def mapFlatten[B](f: (A) ⇒ Iterable[B])(implicit arg0: WireFormat[B]): DList[B]
Why do we call mapFlatten
with
mapFlatten{
instead of
mapFlatten({
Is it because the function is taking a predicate as a paramater?
in this sense, are while, else, if functions too?