Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left

  Apply Now

Apache Spark Basics

33 / 89
INSTRUCTIONS
  • Method 1: By Directly Loading a file from remote

    var lines = sc.textFile("/data/mr/wordcount/input/big.txt")
    

    Write the following command in a new cell:

    lines.take(10)
    
  • Method 2: By distributing existing object

    val arr = 1 to 10000
    var nums = sc.parallelize(arr)
    

    Write the following command in a new cell:

    nums.take(10)
    

Loading comments...