You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jiatao Tao (Jira)" <ji...@apache.org> on 2020/11/10 08:13:00 UTC

[jira] [Comment Edited] (CALCITE-4385) Simplifies AND/OR condition that has common expressions, extract and eliminate/merge them as much as possible

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

Jiatao Tao edited comment on CALCITE-4385 at 11/10/20, 8:12 AM:
----------------------------------------------------------------

Simplifies AND/OR condition that has common expressions, extract and eliminate/merge them as much as possible (Jiatao Tao)
1. (a || b) && (a || b || c || d) => (a || b)
2. (a || b || c || d) && (a || b || e || f) => (a || b) || ((c || d) && (e || f))

3. (a && b) || (a && b && c) => (a && b)
4. (a && b && c && d) || (a && b && e && f) => (a && b) && ((c && d) || (e && f))

The difference between \{@link #simplifyAnd} is that \{@link #simplifyAnd} mainly
simplifies expressions whose answer can be determined without evaluating both sides,
like: FALSE AND (xxx) => FALSE


was (Author: aron.tao):
1. (a && b) || (a && b && c && ...) => a && b

2. (a && b && c && ...) || (a && b && d && ...) => a && b && ((c && ...) || (d && ...))

 

1. (a || b || c || ...) && (a || b) => (a || b)

2. (a || b || c || ...) && (a || b || d || ...) => a || b || ((c || ...) && (d || ...))

> Simplifies AND/OR condition that has common expressions, extract and eliminate/merge them as much as possible
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4385
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4385
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>            Reporter: Jiatao Tao
>            Assignee: Jiatao Tao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)