spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ram kumar <ramkumarro...@gmail.com>
Subject Re: Getting error in inputfile | inputFile
Date Fri, 15 Jul 2016 07:21:09 GMT
check the "*inputFile*" variable name
lol

On Fri, Jul 15, 2016 at 12:12 PM, RK Spark <rkphdspark@gmail.com> wrote:

> I am using Spark version is 1.5.1, I am getting errors in first program of
> spark,ie.e., word count. Please help me to solve this
>
> *scala> val inputfile = sc.textFile("input.txt")*
> *inputfile: org.apache.spark.rdd.RDD[String] = MapPartitionsRDD[13] at
> textFile at <console>:21*
>
> *scala> val counts = inputFile.flatMap(line => line.split(" ")).map(word
> => (word,1)).reduceByKey(_ + _);*
> *<console>:19: error: not found: value inputFile*
> *       val counts = inputFile.flatMap(line => line.split(" ")).map(word
> => (word,1)).reduceByKey(_ + _);*
> *                    ^*
>
>

Mime
View raw message