Skip to content

Conversation

@morrySnow
Copy link
Contributor

we use two facilities to do predicate infer: PredicatePropagation and PullUpPredicates. When we do propagation in PredicatePropagation, we save the source predicates could be used in the upper node. However, we shoud not save any predicates from join on clause. Because these expression is not same with predicate in filter and could not prepagate to other not except the join's Immediate children.

For example:

select a.c1
   from a
   left join b on a.c2 = b.c2 and a.c1 = '1'
   left join c on a.c2 = c.c2 and a.c1 = '2'
   inner join d on a.c3=d.c3

the predicates a.c1 = '1' and a.c1 = '2' should not be inferred as filter to relation a

we use two facilities to do predicate infer: PredicatePropagation and
PullUpPredicates. When we do propagation in PredicatePropagation, we
save the source predicates could be used in the upper node. However, we
shoud not save any predicates from join on clause. Because these
expression is not same with predicate in filter and could not prepagate
to other not except the join's Immediate children.

For example:

```sql
select a.c1
   from a
   left join b on a.c2 = b.c2 and a.c1 = '1'
   left join c on a.c2 = c.c2 and a.c1 = '2'
   inner join d on a.c3=d.c3
```

the predicates `a.c1 = '1'` and `a.c1 = '2'` should not be inferred as
filter to relation `a`
@morrySnow morrySnow marked this pull request as draft August 24, 2023 10:08
@morrySnow
Copy link
Contributor Author

fix by #23456

@morrySnow morrySnow closed this Aug 24, 2023
@morrySnow morrySnow deleted the fix_infer_predicate branch August 24, 2023 14:53
@morrySnow morrySnow removed the p0_w label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants