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