GitHub user yijieshen opened a pull request:
https://github.com/apache/spark/pull/5509
[SQL]Eliminate partition filters from execution.Filter if partition key is
included neither in original schema nor in filter's parents
Suppose I have a table t(id: String, event: String) saved as parquet file,
and have directory hierarchy: hdfs://path/to/data/root/dt=2015-01-01/hr=00
After partition discovery, the result schema should be (id: String, event:
String, dt: String, hr: Int)
If I have a query like:
df.select($âidâ).filter(event match).filter($âdtâ >
â2015-01-01â).filter($âhrâ > 13)
In current implementation, after (dt > 2015-01-01 && hr >13) is used to
filter partitions,
these two filters remains in execution plan and result in each row returned
from parquet add two fields dt & hr each time,
This PR just eliminate the partition filters from execution.Filter as well
as requestedColumns from parquetRelation2, if partition key is included neither
in original schema nor in filter's parents, therefore avoid the row
construction involved in each row.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/yijieshen/spark master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5509.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 #5509
----
commit 1649b0e35e77ab08f9014f9de50af2b987bde990
Author: Yijie Shen <[email protected]>
Date: 2015-04-14T13:52:40Z
Eliminate partition filters from execution.Filter if partition key is
included neither in original schema nor in filter's parents
----
---
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]