I think Calcite always pushes down equal join conditions. In 
SqlToRelConverter.createJoin(), before ruction returns, it calls 
RelOptUtil.pushDownJoinConditions(). So in your example, the cast expression 
will be pushed down and it will still be an equal join.

> On Apr 15, 2019, at 5:40 PM, Yuzhao Chen <yuzhao....@gmail.com> wrote:
> 
> If we checkout the java doc for Calcite EuqiJoin, there is definition for it:
>>  for any join whose condition is based on column equality
> 
> But what about if there are function calls in the equi condition operands ? 
> For example:
> Should we consider
> 
> Select A.a, B.b from A join B on cast(A.a as int) = B.b
> 
> as an equi join ?
> 
> Now Calcite think it is not, which I think will lost some possibilities for 
> sql plan promotion, e.g. join condition push down.
> 
> Best,
> Danny Chan

Reply via email to