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 2019/05/03 00:37:15 UTC
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #24518:
[SPARK-27627][SQL] Make option "pathGlobFilter" as a general option for all
file sources
dongjoon-hyun commented on a change in pull request #24518: [SPARK-27627][SQL] Make option "pathGlobFilter" as a general option for all file sources
URL: https://github.com/apache/spark/pull/24518#discussion_r280640723
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningAwareFileIndex.scala
##########
@@ -69,7 +75,7 @@ abstract class PartitioningAwareFileIndex(
val files: Seq[FileStatus] = leafDirToChildrenFiles.get(path) match {
case Some(existingDir) =>
// Directory has children files in it, return them
- existingDir.filter(isNonEmptyFile)
+ existingDir.filter(f => isNonEmptyFile(f) && matchGlobPattern(f))
Review comment:
Nice, @gengliangwang . BTW, can we switch put `matchGlobPattern(f)` first like `matchGlobPattern(f) && isNonEmptyFile(f)` in order to avoid `f.getLen` more?
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org