Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20611#discussion_r178801061
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala ---
    @@ -385,7 +385,9 @@ case class LoadDataCommand(
             val hadoopConf = sparkSession.sessionState.newHadoopConf()
             val srcPath = new Path(hdfsUri)
             val fs = srcPath.getFileSystem(hadoopConf)
    -        if (!fs.exists(srcPath)) {
    +        // Check if the path exists or there are matched paths if it's a 
path with wildcard.
    +        // For HDFS path, we support wildcard in directory name and file 
name.
    +        if (null == fs.globStatus(srcPath) || 
fs.globStatus(srcPath).isEmpty) {
    --- End diff --
    
    Up to my knowledge, it's fine to use `fs.globStatus` for both hdfs and 
local path. I think that Hadoop's interface should guarantee it at least.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to