Q1:
select * from t1, t2 where t1.a = t2.b and t1.a = 2;
It is equivalent to follow query.
Q2:
select * from t1, t2 where t1.a = t2.b and t1.a = 2 and t2.b = 2;
Now, I use Apache Calcites to generate plan for Q1, and use FilterJoinRule.FILTER_ON_JOIN
and FilterJoinRule.JOIN
to optimize it. But these rules do not derive additional filter t2.b = 2
.
Is there any rules or methods to derive equivalent filter at Calcite? Thanks.
If not, I want to support it. Any suggestion?