I am currently following the youtube series for scala ( https://www.youtube.com/watch?v=Iz74aWSnb5c&list=PLf0swTFhTI8qtOLP5rWmwonnlilIBIrsl&index=15 )
I have imported the ls2014.tsv file which contains the election result and getting the below error.
scala> import scala.io.Source
scala> val fn="/home/thinksathya/sathya/ls2014.tsv"
fn: String = /home/thinksathya/sathya/ls2014.tsv
scala> val a = Source.fromFile(fn).getLines
a: Iterator[String] = non-empty iterator
res8: Int = 8356
res9: Int = 0
When I provide the a.size command twice all the data are getting deleted. Could you help me with this issue.
While calculating Nota, if I give take command or size command all the data are getting deleted.
Also while looking for group by it gives Out of Bound exception.
To brief, while providing the take or size command all the data are getting deleted and have to start from the first each time.