Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/scala/com/springml/spark/sftp/DefaultSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class DefaultSource extends RelationProvider with SchemaRelationProvider with Cr
val hadoopConf = sqlContext.sparkContext.hadoopConfiguration
val hdfsPath = new Path(fileLocation)
val fs = hdfsPath.getFileSystem(hadoopConf)
if ("hdfs".equalsIgnoreCase(fs.getScheme)) {
if (!"file".equalsIgnoreCase(fs.getScheme)) {
fs.copyFromLocalFile(new Path(fileLocation), new Path(hdfsTemp))
val filePath = hdfsTemp + "/" + hdfsPath.getName
fs.deleteOnExit(new Path(filePath))
Expand All @@ -152,7 +152,7 @@ class DefaultSource extends RelationProvider with SchemaRelationProvider with Cr
val hadoopConf = sqlContext.sparkContext.hadoopConfiguration
val hdfsPath = new Path(hdfsTemp)
val fs = hdfsPath.getFileSystem(hadoopConf)
if ("hdfs".equalsIgnoreCase(fs.getScheme)) {
if (!"file".equalsIgnoreCase(fs.getScheme)) {
fs.copyToLocalFile(new Path(hdfsTemp), new Path(fileLocation))
fs.deleteOnExit(new Path(hdfsTemp))
return fileLocation
Expand Down