Open kaikalur opened 4 months ago
This is should even if you have additional join keys
Hi @kaikalur, I also very interested in this feature. Have you ever see any optimizer implement this rule or any theoretical proof. There is a similar issue in Trino https://github.com/trinodb/trino/issues/3722, but it is nor active for a long time.
There is a related discussion in calcite, the pushdown rule can be generalize to more expression other than coalesce. https://issues.apache.org/jira/browse/CALCITE-5193
Hi @kaikalur, I also very interested in this feature. Have you ever see any optimizer implement this rule or any theoretical proof. There is a similar issue in Trino trinodb/trino#3722, but it is nor active for a long time.
Not sure what you mean by theoretical proof. But this is legit. Sure there are possibly other expressions but this is a common real life usecase so we can implement this.
@kaikalur I total agree to push down a coalesce expression filter through outer join. I can't think of a counterexample. I just want to know have you see some material that disscusses what kind of expression can be push through the full join and how to do it.
@kaikalur I total agree to push down a coalesce expression filter through outer join. I can't think of a counterexample. I just want to know have you see some material that disscusses what kind of expression can be push through the full join and how to do it.
There are many rules that do pushdowns so once you find out which side to push what and go from there. it needs to be done after all other pushdowns. Also looks like we do this for inner join already so this maybe just relaxing the condition in an existing rule
We currently do not pushdown the filter (part like '%a%' down) to the scans. But carefully observing the semantics of coalesce, this can be pushdown below join. It currently works for inner join but it should work outer/full join as well.
CC: @feilong-liu