[ 
https://issues.apache.org/jira/browse/CALCITE-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453810#comment-16453810
 ] 

Zoltan Haindrich commented on CALCITE-2247:
-------------------------------------------

After a few loose ends, I think I've finally found the right place for this to 
be...and it seems to be working right :)
Thank you [~julianhyde] for the suggestion to extend the predicates 
progressively as the simplification goes - it really helped a lot :D

I've started by "sorting" the terms to have the comparisions first; but it 
doesn't seem to be right - because in some cases it raised the rule application 
count by a magnitude.
Currently I do 2 passes on the AND operator's terms:

* during first pass only comparisions are simplified and added as predicates
* second pass on non-direct comparisions

This seems to be working good; and doesn't raise rule apply counts in 
HepPlannerTest

> Add rule to push in condition condition into a related disjunctive expression
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-2247
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2247
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>
> Simplify expressions like: {code}a = 1 AND (a = 1 OR a = 2){code} to {code}a 
> = 1{code}
> Conditions to apply will be:
> * in an AND condition there exists a comparison(c) and an OR (o)
> * o and c only reference 1 variable
> See HIVE-19097 for more info.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to