public MergeJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, RexNode condition,
JoinRelType joinType) throws InvalidRelException {
super(cluster, traits, left, right, condition, joinType);
if (condition.isAlwaysTrue()) {
throw new InvalidRelException("MergeJoinPrel does not support cartesian product join");
}
RexNode remaining = RelOptUtil.splitJoinCondition(left, right, condition, leftKeys, rightKeys);
if (!remaining.isAlwaysTrue() && (leftKeys.size() == 0 || rightKeys.size() == 0)) {
throw new InvalidRelException("MergeJoinPrel only supports equi-join");
}
}