GitHub user chenghao-intel opened a pull request:
https://github.com/apache/spark/pull/8916
[SPARK-10829][SQL]Filter combine partition key and attribute doesn't work
in DataSource scan
```scala
withSQLConf(SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> "true") {
withTempPath { dir =>
val path = s"${dir.getCanonicalPath}/part=1"
(1 to 3).map(i => (i, i.toString)).toDF("a",
"b").write.parquet(path)
// If the "part = 1" filter gets pushed down, this query will throw
an exception since
// "part" is not a valid column in the actual Parquet file
checkAnswer(
sqlContext.read.parquet(path).filter("a > 0 and (part = 0 or a >
1)"),
(2 to 3).map(i => Row(i, i.toString, 1)))
}
}
```
We expect the result to be:
```
2,1
3,1
```
But got
```
1,1
2,1
3,1
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/chenghao-intel/spark partition_filter
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/8916.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 #8916
----
commit 1c0ba50edc2ea6c09af634ede4068bd9879abff0
Author: Cheng Hao <[email protected]>
Date: 2015-09-25T05:51:32Z
Scan DataSource with predicate expression combine partition key and
attributes doesn't work
----
---
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]