spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wzhfy <...@git.apache.org>
Subject [GitHub] spark pull request #20611: [SPARK-23425][SQL]Support wildcard in HDFS path f...
Date Thu, 15 Mar 2018 13:03:27 GMT
Github user wzhfy commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20611#discussion_r174771588
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
---
    @@ -385,8 +385,12 @@ case class LoadDataCommand(
             val hadoopConf = sparkSession.sessionState.newHadoopConf()
             val srcPath = new Path(hdfsUri)
             val fs = srcPath.getFileSystem(hadoopConf)
    -        if (!fs.exists(srcPath)) {
    -          throw new AnalysisException(s"LOAD DATA input path does not exist: $path")
    +        // A validaton logic is been added for non local files, Error will be thrown
    +        // If hdfs path doest not exist or if no files matches the wild card defined
    +        // in load path
    +        if (null == fs.globStatus(srcPath) || fs.globStatus(srcPath).isEmpty) {
    +          throw new AnalysisException(s"LOAD DATA input path does not exist " +
    +            s"or no files are matching the wildcard string: $path")
    --- End diff --
    
    I think the previous message ("LOAD DATA input path does not exist: $path") is fine, it
covers the case no path matches the wildcard, like the above case for local path.


---

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


Mime
View raw message