@Override
    public void onMatch(RelOptRuleCall call) {
      final Join join = call.rel(0);
      RexInBetweenExpander expander = new RexInBetweenExpander(
          join.getCluster().getRexBuilder());
      RexNode condition = expander.apply(join.getCondition());

      if (!expander.modified) {
        return;
      }

      RelNode newJoin = join.copy(join.getTraitSet(),
          condition,
          join.getLeft(),
          join.getRight(),
          join.getJoinType(),
          join.isSemiJoinDone());

      call.transformTo(newJoin);
    }
Rule adapter to apply the transformation to Join conditions.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveInBetweenExpandRule.java