GitHub user xuanyuanking opened a pull request:

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

    [SPARK-4502][SQL]Support parquet nested struct pruning and add releva…

    ## What changes were proposed in this pull request?
    
    Like the description in  
[SPARK-4502](https://issues.apache.org/jira/browse/SPARK-4502), we have the 
same problem in Baidu and our user's parquet file has complex nested parquet 
struct(400+ fields and 4 layer nested) so this problem brings unnecessary data 
read and time spend. This pr fixed the problem and main fix ideas list as 
follows:
    
    1.  Add booleanConf `spark.sql.parquet.nestColumnPruning`, when it’s 
closed, same logical with before
    
    2.  In `FileSourceStrategy`, traverse `projects[NamedExpression]` and 
generate a map which key is attributeName, value is a Seq[String] of 
corresponding nested fields.
    For example:  [“people” -> (“people.age”, “people.addr.city”)] 
    
    3. Replace the attributeName in origin requiredColumns.
    For example:  origin requiredColumns is [“people”, “consume”], 
replace it to [“people.age”, “people.addr.city”, “consume”]
    
    4. Merge structType of fields in same structType and merge filter attributes
    For example:  the json format of struct type [“people.addr.city”, 
“people.addr.zip_code”] will merge to [“people.addr.[city,zip_code]”]
    
    5.  `StructType.apply` read the columns contains “.” Recursively
    
    
    ## How was this patch tested?
    
    add new test in `ParquetQuerySuite`

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

    $ git pull https://github.com/xuanyuanking/spark SPARK-4502

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

    https://github.com/apache/spark/pull/14957.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 #14957
    
----
commit 7eaa4287a5c112a192cca388863324ffd855203e
Author: liyuanjian <liyuanj...@baidu.com>
Date:   2016-09-05T08:27:02Z

    [SPARK-4502][SQL]Support parquet nested struct pruning and add relevant 
tests

----


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

Reply via email to