I am trying run some scala code in spark following an online video tutorial: it's a wordcount program
val lines = sc.textFile("/data/mr/wordcount/big.txt")
val words = lines.flatMap(x => x.split(" "))
val pairs = words.map(s => (s.toLowerCase(), 1))
val counts = pairs.reduceByKey((a, b) => a + b)
counts.take(10)
<console>:24: error: not found: value counts
counts.take(10)
^
and it's the same error whenever I run ever command that does not start with val