[ https://issues.apache.org/jira/browse/CALCITE-5872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17747273#comment-17747273 ]
grandfisher edited comment on CALCITE-5872 at 7/26/23 5:28 AM: --------------------------------------------------------------- All the schema in our test is that field type name was field name. All tables schema was same and is {code:java} id int, long_field long, string_field varchar {code} There is the sql: {code:java} `SELECT * FROM ( SELECT * FROM ( SELECT id, long_field / 2 AS long_field, string_field FROM `table-v1` WHERE id > 13 AND long_field / 2 > 767 ORDER BY id ASC ) a RIGHT JOIN ( SELECT id, long_field, string_field FROM `table-v2` WHERE id > 17 AND long_field / 3 > 222 ORDER BY id ASC ) b ON a.id = b.id AND a.long_field = b.long_field WHERE a.id > 0 OR a.long_field > 0 ) s RIGHT JOIN `table_single-v1` c ON c.string_field = s.string_field WHERE c.string_field = '0';` {code} The rules that used in our test was: JoinPushTransitivePredicatesRule.Config.DEFAULT, FilterJoinRule.FilterIntoJoinRule.Config.DEFAULT, FilterJoinRule.JoinConditionPushRule.Config.DEFAULT, FilterAggregateTransposeRule.Config.DEFAULT, FilterProjectTransposeRule.Config.DEFAULT, FilterSetOpTransposeRule.Config.DEFAULT, FilterMergeRule.Config.DEFAULT, was (Author: JIRAUSER298606): All the schema in our test is that field type name was field name. All tables schema was same and is ``` id int, long_field long, string_field varchar ``` There is the sql: `SELECT * FROM ( SELECT * FROM ( SELECT id, long_field / 2 AS long_field, string_field FROM `table-v1` WHERE id > 13 AND long_field / 2 > 767 ORDER BY id ASC ) a RIGHT JOIN ( SELECT id, long_field, string_field FROM `table-v2` WHERE id > 17 AND long_field / 3 > 222 ORDER BY id ASC ) b ON a.id = b.id AND a.long_field = b.long_field WHERE a.id > 0 OR a.long_field > 0 ) s RIGHT JOIN `table_single-v1` c ON c.string_field = s.string_field WHERE c.string_field = '0';` The rules that used in our test was: JoinPushTransitivePredicatesRule.Config.DEFAULT, FilterJoinRule.FilterIntoJoinRule.Config.DEFAULT, FilterJoinRule.JoinConditionPushRule.Config.DEFAULT, FilterAggregateTransposeRule.Config.DEFAULT, FilterProjectTransposeRule.Config.DEFAULT, FilterSetOpTransposeRule.Config.DEFAULT, FilterMergeRule.Config.DEFAULT, > JoinPushTransitivePredicatesRule will repeatedly insert the condition "is not > null" > ----------------------------------------------------------------------------------- > > Key: CALCITE-5872 > URL: https://issues.apache.org/jira/browse/CALCITE-5872 > Project: Calcite > Issue Type: Bug > Components: core > Reporter: grandfisher > Priority: Major > > JoinPushTransitivePredicatesRule will repeatedly insert the condition "is not > null" and will always optimize by `VolcanoPlanner` -- This message was sent by Atlassian Jira (v8.20.10#820010)