Convert a simple one line string to RDD in Spark
try using List as parameter:
sc.parallelize(List(line)).collect()
it returns
res1: Array[String] = Array(hello,world)
use the following code :
sc.parallelize(Seq(line))
The below code works fine in Python
sc.parallelize([line]).collect()['Hello, world']
Here we are passing the parameter "line" as a list.