Spark Shell Running into Loop

spark-shell

#1

Hi all,

I have triggered Spark shell using
spark-shell --master yarn-client --conf spark.ui.port=23456
Once shell is open, i am running below code.
Last but 3rd line runs into loop and finally fails to execute properly.
I am working in gw01 gateway node.
Can any one try and see if you can get fix?

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

val r=sc.parallelize((1 to 100).toList)
r.filter(x => x%2 ==0).take(2)

val conf=new SparkConf().setAppName(“Test Spark”).setMaster(“local”)
sc.stop
val sc=new SparkContext(conf)
val r=sc.parallelize((1 to 100).toList)
r.filter(x => x%2 ==0).take(2)

val conf=new SparkConf().setAppName(“Test Spark”).setMaster(“yarn-client”)
sc.stop
val sc=new SparkContext(conf)
val r=sc.parallelize((1 to 100).toList)
r.filter(x => x%2 ==0).take(2)