FatalLin commented on a change in pull request #32202:
URL: https://github.com/apache/spark/pull/32202#discussion_r615271527
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
##########
@@ -277,6 +278,31 @@ private[hive] class HiveMetastoreCatalog(sparkSession:
SparkSession) extends Log
result.copy(output = newOutput)
}
+ private def getDirectoryPathSeq(rootPath: Path): Seq[String] = {
+ val enableSupportSubDirectories =
+ sparkSession.conf.getOption("hive.mapred.supports.subdirectories")
+
+ if (enableSupportSubDirectories.isDefined &&
enableSupportSubDirectories.get.toBoolean) {
+ val fs =
rootPath.getFileSystem(sparkSession.sessionState.newHadoopConf())
+ val paths = new scala.collection.mutable.ListBuffer[String]
+
+ val checkingQueue = new mutable.Queue[Path]()
+ checkingQueue.enqueue(rootPath)
+ while (!checkingQueue.isEmpty) {
+ val path = checkingQueue.dequeue()
+ paths.append(path.toString)
+ fs.listStatus(path).foreach(fileStatus => {
+ if (fileStatus.isDirectory) {
+ checkingQueue.enqueue(fileStatus.getPath)
+ }
+ })
+ }
+ paths
Review comment:
Didn't notice the function before, will change it. Thanks.
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]