我正在尝试按照在线视频教程在 spark 中运行一些 scala 代码:这是一个 wordcount 程序
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)
^
每当我运行不以 val 开头的命令时,都会出现相同的错误