How to read a tab separated text file and display the details in a table using spark and Scala
How to read a tab separated text file and display the details in a table using spark and Scala 1. Read a text (tab separated) file which needs to be processed. scala> val election2014 = sc.textFile("file:///home/hadoop/workspace/scala/rajudata/data-master/electionresults/ls2014.tsv") election2014: org.apache.spark.rdd.RDD[String] = file:///home/hadoop/workspace/scala/rajudata/data-master/electionresults/ls2014.tsv MapPartitionsRDD[59] at textFile at <console>:24 Note: You can get the data file at below location. https://github.com/dgadiraju/data/tree/master/electionresults 2. The input text file is having a header. Which needs to be filtered before actual processing. scala> election2014.first res72: String = state constituency candidate_name sex age ...