Github user srinathshankar commented on a diff in the pull request:
https://github.com/apache/spark/pull/14912#discussion_r77383932
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala
---
@@ -171,6 +172,27 @@ class FilterPushdownSuite extends PlanTest {
comparePlans(optimized, correctAnswer)
}
+ test("push down filters that are combined") {
+ // The following predicate ('a === 2 || 'a === 3) && ('c > 10 || 'a
=== 2)
+ // will be simplified as ('a == 2) || ('c > 10 && 'a == 3).
+ // ('a === 2 || 'a === 3) can be pushed down. But the simplified one
can't.
--- End diff --
So what happens if I just have the predicate
(a = 2) || (c > 10 && a = 3)
Will anything will be pushed down ? Have you considered instead modifying
the boolean simplification logic.
Another approach that will catch these cases is as follows:
1.a Convert filters to conjunctive normal form
1.b combine filters
1.c Push filters
1.a, b and c will be run in a batch until fixed point.
Follow this batch by BooleanSimplification -- this can find and extract
common factors for efficiency.
Overall, cnf may maximize the potential for filter push down
---
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]