Handling Partitioned and Non Partitioned Data in Spark Processor using Scala