Github user scwf commented on the pull request:
https://github.com/apache/spark/pull/3778#issuecomment-68140510
Not only, actually this PR cover optimizations as follows:
```
And/Or with same condition
a && a => a , a && a && a ... => a
a || a => a , a || a || a ... => a
one And/Or with conditions that can be merged
a < 2 && a > 2 => false, a > 3 && a > 5 => a > 5
a < 2 || a >= 2 => true, a > 3 || a > 5 => a > 3
two And/Or with conditions that can be merged
(a < 3 && b > 5) || a > 2 => b > 5 || a > 2
(a < 3 || b > 5) || a > 2 => true
(a < 2 && b > 5) && a > 3 => flase
(a < 2 || b > 5) && a > 3 => b > 5 && a > 3
more than two And/Or with common conditions
(a && b && c && ...) || (a && b && d && ...) || (a && b && e && ...) ... =>
a && b && ((c && ...) || (d && ...) || (e && ...) || ...)
(a || b || c || ...) && (a || b || d || ...) && (a || b || e || ...) ... =>
(a || b) || ((c || ...) && (f || ...) && (e || ...) && ...)
```
hi @liancheng, do you mind i refactory this and refer to your PR to cover
all the cases above?
---
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]