I am trying to execute “spark-submit labtest.jar --master yarn --class com.lab.test.labtest”. Getting error " Cannot load main class from JAR file:/home/aswiniharidas194641/labtest.jar".
Please help me solve this error. jar file uploaded in hue.
My jar file contains below code:
package com.lab.test
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD.rddToPairRDDFunctions
object labtest {
def main(args: Array[String]) = {
val conf = new SparkConf().setAppName(“WordCount”).setMaster(“local”)
val sc = new SparkContext(conf)
val input = sc.textFile(“inputforsparkwordcountapp.txt”)
input.flatMap { line => line.split(" ")
} //for each line split the line into words.
.map { word => (word, 1)}
.reduceByKey(_ + _)
.saveAsTextFile(“outputfiletest”)
sc.stop()
}
}
Thanks,
Aswini