GitHub user windpiger opened a pull request: https://github.com/apache/spark/pull/17081
[SPAKR-18726][SQL][WIP]resolveRelation for FileFormat DataSource don't need to listFiles twice ## What changes were proposed in this pull request? Currently when we resolveRelation for a `FileFormat DataSource` without providing user schema, it will execute `listFiles` twice in `InMemoryFileIndex` during `resolveRelation`. This PR add a `FileStatusCache` for DataSource, this can avoid listFiles twice. But there is a bug in `InMemoryFileIndex` see [SPARK-19748](https://github.com/apache/spark/pull/17079), so this pr should be after SPARK-19748. ## How was this patch tested? N/A You can merge this pull request into a Git repository by running: $ git pull https://github.com/windpiger/spark resolveDataSourceScanFilesTwice Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/17081.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #17081 ---- commit 0082b7633e8f84fe5cafa0362cd45cce4cfee459 Author: windpiger <song...@outlook.com> Date: 2017-02-27T08:04:30Z [SPAKR-18726][SQL]resolveRelation for FileFormate DataSource don't need to listFiles twice ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org