Apache Spark Basics

You are currently auditing this course.
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...