Since the computation is distributed, execution of your code splits the output into multiple parts. If the output is small enough to fit into one machine, then you can use collect at the end of your program.
val array = year.collect()
You may also use coalesce(1) and saveAsTextFile as:
coalesce(1,true).saveAsTextFile(), this basically means do the computation then coalesce to 1 partition. Instead, you can also use repartition(1). But this might be a bad approach if you have a huge pile of data. Separate files per split are generated just like in Hadoop in order to let separate mappers and reducers write to different files. Maintaining a single output file is a good idea if you have a very little amount of data.
If you want to know more about Scala, then do check out this awesome video tutorial: