Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize filter predicates #1

Closed
aalexandrov opened this issue Feb 26, 2015 · 4 comments
Closed

Normalize filter predicates #1

aalexandrov opened this issue Feb 26, 2015 · 4 comments

Comments

@aalexandrov
Copy link
Contributor

Complex boolean predicates should be normalized to CNF and treated as a chain of filters in the comprehend method time.

For example, the following comprehension

val res = for (
  x <- X; 
  y <- Y; 
  z <- Z; 
  if x.a = "a" && x.b = "b" && x.a = y.a && x.b = z.b) yield (x,y,z)

should be executed effectively rewritten as

val res = for (
  x <- X; 
  y <- Y; 
  z <- Z; 
  if x.a = "a"; if x.b = "b"; if x.a = y.a; if x.b = z.b) yield (x,y,z)

The CombinatorRewriteEngine state machine will then handle predicate push-down and generate a plan with early filters and joins instead of a crosses followed by a filter.

@aalexandrov aalexandrov added this to the Week 10 2015 milestone Feb 26, 2015
@aalexandrov aalexandrov removed this from the Week 10 2015 milestone Mar 3, 2015
@aalexandrov
Copy link
Contributor Author

A good overview of the role of normalization in the classic relational setting can be found in this article.

@akunft
Copy link
Contributor

akunft commented Apr 15, 2015

@fschueler For the normalization to CNF I have some code already that i can provide.

@aalexandrov aalexandrov added this to the Week 19 2015 milestone Apr 30, 2015
@fschueler
Copy link
Contributor

@akunft can you point me to the code?

@akunft
Copy link
Contributor

akunft commented Apr 30, 2015

https://github.com/akunft/ozone/tree/3f093e6b2cf5709327fb77f12a95772f3652e118/pact/pact-common/src/main/java/eu/stratosphere/pact/common/io/pax/selection

This package contains all the predicate conversion stuff. The CNFConverter does the normalization.

@aalexandrov aalexandrov modified the milestones: Week 19 2015, Week 22 2015, Week 21 2015 Oct 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants