Github user scwf commented on a diff in the pull request:
https://github.com/apache/spark/pull/2576#discussion_r19051903
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTableOperations.scala
---
@@ -504,19 +505,41 @@ private[parquet] object FileSystemHelper {
fs.listStatus(path).map(_.getPath)
}
- /**
- * Finds the maximum taskid in the output file names at the given path.
- */
- def findMaxTaskId(pathStr: String, conf: Configuration): Int = {
+ /**
+ * List files with special extension
+ */
+ def listFiles(origPath: Path, conf: Configuration, extension: String):
Seq[Path] = {
+ val fs = origPath.getFileSystem(conf)
+ if (fs == null) {
+ throw new IllegalArgumentException(
+ s"OrcTableOperations: Path $origPath is incorrectly formatted")
+ }
+ val path = origPath.makeQualified(fs)
+ if (fs.exists(path) && fs.getFileStatus(path).isDir) {
+ fs.listStatus(path).map(_.getPath).filter(p =>
p.getName.endsWith(extension))
--- End diff --
But ```globStatus``` does not list the files of the path, here we should
list the *.orc or *.parquet files under this dir.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]