GitHub user andrey-tpt opened a pull request: https://github.com/apache/spark/pull/18623
[SPARK-21374][CORE] Fix reading globbed paths from S3 into DF with disabled FS cache ## What changes were proposed in this pull request? SparkHadoopUtil.globPath method uses incorrect configuration to retrieve instance of org.apache.hadoop.fs.FileSystem. Accidentally, this can work correctly for two reasons: - Filesystem cache is enabled by default for all filesystems which are derived from org.apache.hadoop.fs.FileSystem - Configuration is not considered when instance of FileSystem is retrieved from the cache - it is not used to identify cache's key. Therefore, incorrect configuration is omitted in SparkHadoopUtil.globPath and previously initialized instance of FileSystem is returned with correct configuration. However, if filesystem caching is disabled (non-default behavior) incorrect configuration in SparkHadoopUtils.globPath is passed to org.apache.hadoop.fs.FileSystem.get() method what creates new instance of FileSystem with this incorrect configuration. In this change two overloaded methods (globPath and globPathIfNecessary) are added to SparkHadoopUtil class which can receive up to date configuration from caller method. These two methods are used in DataSource class to read into DataFrame from globbed path. ## How was this patch tested? ./dev/run-tests passed + example from SPARK-21374 was tested with patched jars. @zsxwing @liancheng You can merge this pull request into a Git repository by running: $ git pull https://github.com/andrey-tpt/spark globpath2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/18623.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 #18623 ---- commit 317bd1b63cc38e82bc1b09c53a68d4dd202aa4e8 Author: Andrey Taptunov <taptu...@amazon.com> Date: 2017-07-13T10:50:42Z [SPARK-21374][CORE] Fix reading globbed paths from S3 into DF with disabled FS cache ---- --- 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