Q1:
select * from t1, t2 where t1.a = t2.b and t1.a = 2;
相当于follow query。
Q2:
select * from t1, t2 where t1.a = t2.b and t1.a = 2 and t2.b = 2;
现在,我使用 Apache Calcites 为 Q1 生成计划,并使用FilterJoinRule.FILTER_ON_JOIN
和FilterJoinRule.JOIN
优化它。但是这些规则并没有派生出额外的过滤器t2.b = 2
。
是否有任何规则或方法可以在 Calcite 导出等效过滤器?谢谢。
如果没有,我想支持它。有什么建议吗?