[jira] [Commented] (CALCITE-2190) Extend SubstitutionVisitor.splitFilter to cover different order of operands
[ https://issues.apache.org/jira/browse/CALCITE-2190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16382981#comment-16382981 ] Jesus Camacho Rodriguez commented on CALCITE-2190: -- I forgot to merge last commit addressing the comment about single element; fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/483c0a61b . > Extend SubstitutionVisitor.splitFilter to cover different order of operands > --- > > Key: CALCITE-2190 > URL: https://issues.apache.org/jira/browse/CALCITE-2190 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Jesus Camacho Rodriguez >Assignee: Jesus Camacho Rodriguez >Priority: Major > Fix For: 1.16.0 > > > {{SubstitutionVisitor.splitFilter}} does structural comparison to identify > relevant predicates. The method could sort the operands for some expressions > in a deterministic way to maximize possible matches. > For instance, currently this example yields correct results: > {code} > condition: x = 1 or y = 2 > target:y = 2 or x = 1 > -> residue: true > {code} > However, the following equivalent example fails: > {code} > condition: x = 1 or y = 2 > target:y = 2 or 1 = x > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2190) Extend SubstitutionVisitor.splitFilter to cover different order of operands
[ https://issues.apache.org/jira/browse/CALCITE-2190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16374984#comment-16374984 ] Julian Hyde commented on CALCITE-2190: -- Not perfect, but progress. +1 See my comment about using TreeMap; fix if you think it makes sense. > Extend SubstitutionVisitor.splitFilter to cover different order of operands > --- > > Key: CALCITE-2190 > URL: https://issues.apache.org/jira/browse/CALCITE-2190 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Jesus Camacho Rodriguez >Assignee: Jesus Camacho Rodriguez >Priority: Major > > {{SubstitutionVisitor.splitFilter}} does structural comparison to identify > relevant predicates. The method could sort the operands for some expressions > in a deterministic way to maximize possible matches. > For instance, currently this example yields correct results: > {code} > condition: x = 1 or y = 2 > target:y = 2 or x = 1 > -> residue: true > {code} > However, the following equivalent example fails: > {code} > condition: x = 1 or y = 2 > target:y = 2 or 1 = x > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CALCITE-2190) Extend SubstitutionVisitor.splitFilter to cover different order of operands
[ https://issues.apache.org/jira/browse/CALCITE-2190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373832#comment-16373832 ] Jesus Camacho Rodriguez commented on CALCITE-2190: -- [~julianhyde], could you review https://github.com/apache/calcite/pull/635 ? It is not a complete solution by any means, but it will help us solving the most common cases. > Extend SubstitutionVisitor.splitFilter to cover different order of operands > --- > > Key: CALCITE-2190 > URL: https://issues.apache.org/jira/browse/CALCITE-2190 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Jesus Camacho Rodriguez >Assignee: Jesus Camacho Rodriguez >Priority: Major > > {{SubstitutionVisitor.splitFilter}} does structural comparison to identify > relevant predicates. The method could sort the operands for some expressions > in a deterministic way to maximize possible matches. > For instance, currently this example yields correct results: > {code} > condition: x = 1 or y = 2 > target:y = 2 or x = 1 > -> residue: true > {code} > However, the following equivalent example fails: > {code} > condition: x = 1 or y = 2 > target:y = 2 or 1 = x > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)