GitHub user davies opened a pull request:

    https://github.com/apache/spark/pull/13094

    [SPARK-15307]  [SQL] speed up listing files for data source

    ## What changes were proposed in this pull request?
    
    Currently, listing files is very slow if there is thousands files, 
especially on local file system, because:
    1) FileStatus.getPermission() is very slow on local file system, which is 
launch a subprocess and parse the stdout.
    2) Create an JobConf is very expensive (ClassUtil.findContainingJar() is 
slow).
    
    This PR improve these by:
    1) Use another constructor of LocatedFileStatus to avoid calling 
FileStatus.getPermission, the permissions are not used for data sources.
    2) Only create an JobConf once within one task.
    
    ## How was this patch tested?
    
    Manually tests on a partitioned table with 1828 partitions, decrease the 
time to load the table from 22 seconds to 1.6 seconds (Most of time are spent 
in merging schema now).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/davies/spark listing

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13094.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 #13094
    
----
commit 4ddb83ffddea5e9d383d17367a6b0df1c067a394
Author: Davies Liu <[email protected]>
Date:   2016-05-13T06:59:01Z

    speed up listing

----


---
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]

Reply via email to