SHARE
TWEET

Untitled

a guest May 24th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import org.apache.spark.SparkFiles
  2. import org.apache.spark.SparkContext
  3.  
  4. val context = spark.sparkContext
  5. val fileName = "file.csv"
  6. val fetchedFile = context.addFile(s"ftp://my-ftp-server.net/$fileName")
  7.  
  8. val readFile = context.textFile(SparkFiles.get(fileName)).collect()
  9.  
  10. readFile.foreach(println)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top