You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by wzhfy <gi...@git.apache.org> on 2018/04/03 07:36:51 UTC

[GitHub] spark pull request #20611: [SPARK-23425][SQL]Support wildcard in HDFS path f...

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

    https://github.com/apache/spark/pull/20611#discussion_r178736198
  
    --- 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 --
    
    @HyukjinKwon @dongjoon-hyun  Is it possible to use `fs.globStatus` for both local path and hdfs path?


---

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