I want to list all folders within a hdfs directory using Scala/Spark. In Hadoop I can do this by using the command: hadoop fs -ls hdfs://sandbox.hortonworks.com/demo/<
hadoop fs -ls hdfs://sandbox.hortonworks.com/demo/<
val listStatus = org.apache.hadoop.fs.FileSystem.get(new URI(url), sc.hadoopConfiguration) .globStatus(new org.apache.hadoop.fs.Path(url)) for (urlStatus <- listStatus) { println("urlStatus get Path:" + urlStatus.getPath())
}