You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/12 04:37:20 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #32074: [SPARK-34977][SQL] LIST FILES/JARS/ARCHIVES cannot handle multiple arguments properly when at least one path is quoted

HyukjinKwon commented on a change in pull request #32074:
URL: https://github.com/apache/spark/pull/32074#discussion_r611321847



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/resources.scala
##########
@@ -67,17 +65,16 @@ case class ListFilesCommand(files: Seq[String] = Seq.empty[String]) extends Runn
   }
   override def run(sparkSession: SparkSession): Seq[Row] = {
     val fileList = sparkSession.sparkContext.listFiles()
-    if (files.size > 0) {
-      files.map { f =>
-        val uri = new URI(f)
-        val schemeCorrectedPath = uri.getScheme match {
-          case null | "local" => new File(f).getCanonicalFile.toURI.toString
-          case _ => f
-        }
-        new Path(schemeCorrectedPath).toUri.toString
-      }.collect {
-        case f if fileList.contains(f) => f
-      }.map(Row(_))

Review comment:
       @sarutak, what's the diff here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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