File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution/command Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,6 @@ case class LoadDataCommand(
252252 val fileSystem = FileSystems .getDefault
253253 val pathPattern = fileSystem.getPath(filePath)
254254 val dir = pathPattern.getParent.toString
255- val filePattern = pathPattern.getFileName.toString
256255 if (dir.contains(" *" )) {
257256 throw new AnalysisException (
258257 s " LOAD DATA input path allows only filename wildcard: $path" )
@@ -262,8 +261,8 @@ case class LoadDataCommand(
262261 if (files == null ) {
263262 false
264263 } else {
265- val matcher = fileSystem.getPathMatcher(" glob:" + filePattern )
266- files.exists(f => matcher.matches(fileSystem.getPath(f.getName )))
264+ val matcher = fileSystem.getPathMatcher(" glob:" + pathPattern.toAbsolutePath )
265+ files.exists(f => matcher.matches(fileSystem.getPath(f.getAbsolutePath )))
267266 }
268267 } else {
269268 new File (filePath).exists()
You can’t perform that action at this time.
0 commit comments