Convert a simple one line string to RDD in Spark

Convert a simple one line string to RDD in Spark

Asked on January 12, 2019 in Apache-spark.
Add Comment


  • 1 Answer(s)

    Here the issue can be solved by using List as parameter:

    sc.parallelize(List(line)).collect()
    

    The result will be as:

    res1: Array[String] = Array(hello,world)
    
    Answered on January 12, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.