Sorry I made a mistake : (. It seems that the rule adds filters actively[1] and does not accepts cartesian joins[2]. Besides the effects should be the same.

P.S. Correct a typo from my first email: equal join -> cartesian join

Hongze

[1] https://github.com/apache/calcite/blob/d7946a94adfd2e788f5d324910944dd65dab11ee/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L93-L110 [2] https://github.com/apache/calcite/blob/d7946a94adfd2e788f5d324910944dd65dab11ee/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L59-L61

------ Original Message ------
From: "Hongze Zhang" <[email protected]>
To: [email protected]
Sent: 2019/4/1 12:00:04
Subject: Re: Is sort-merge join rule supports a non-equi join?

As far as you can see, the rule doesn't currently support non-equal join.

While you execute a SQL with non-equal join conditions, the rule can only handle the equal join generated by JoinExtractFilterRule[1]. So AFAIK you are not able to receive performance benefits by this rule so far unless you have sorted join input already.

Best,
Hongze


[1] https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/rules/JoinExtractFilterRule.java

------ Original Message ------
From: "周来" <[email protected]>
To: [email protected]
Sent: 2019/4/1 11:26:48
Subject: Is sort-merge join rule supports a non-equi join?

I want to fire a sort-merge join rule to improve the performance for a
theta join,
but I found the comment of EnumerableMergeJoinRule.java  says
`// EnumerableMergeJoin only supports inner join.
 (It supports non-equi join, using a post-filter; see below.)`.

could someone tell me how to fire the rule for a  non-equi join?

Reply via email to