GitHub user jiangxb1987 opened a pull request:

    https://github.com/apache/spark/pull/15319

    [SPARK-17733][SQL] InferFiltersFromConstraints rule never terminates for 
query

    ## What changes were proposed in this pull request?
    
    The function `QueryPlan.inferAdditionalConstraints` and 
`UnaryNode.getAliasedConstraints` can produce a non-converging set of 
constraints for recursive functions. For instance, if we have two constraints 
of the form(where a is an alias):
    `a = b, a = f(b, c)`
    Applying both these rules in the next iteration would infer:
    `f(b, c) = f(f(b, c), c)`
    This process repeated, the iteration won't converge and the set of 
constraints will grow larger and larger until OOM.
    
    To fix this problem, we collect alias from expressions and skip infer 
constraints if we are to transform an `Expression` to another which contains it.
    
    
    ## How was this patch tested?
    
    Add new testcase in `SQLQuerySuite`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jiangxb1987/spark constraints

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/15319.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 #15319
    
----
commit b77a4d638d29d8d9c939a653d6e79e8edc5203fd
Author: jiangxingbo <[email protected]>
Date:   2016-10-01T04:33:30Z

    modify function inferAdditionalConstraints to avoid producing 
non-converging set of constraints

----


---
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]

Reply via email to