I have a file in a Ubuntu machine which I want to read in Apache spark .
I found this example :
object BasicTextFromFTP {
def main(args: Array[String]) {
val conf = new SparkConf
conf.setMaster(args(0))
val sc = new SparkContext(conf)
val file = sc.textFile("ftp://anonymous:pandamagic@ftp.ubuntu.com/ubuntu/ls-LR.gz")
println(file.collect().mkString("\n"))
}
}
on this link :
https://github.com/databricks/learning-spark/blob/master/src/main/scala/com/oreilly/learningsparkexamples/scala/BasicLoadTextFromFTP.scala
I don’t understand how the URL is created. Please help me with this.