amansinha100 commented on a change in pull request #1514: DRILL-6798: Planner
changes to support semi-join.
URL: https://github.com/apache/drill/pull/1514#discussion_r229765364
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/HashJoinPrel.java
##########
@@ -50,14 +51,21 @@
private int joinControl;
public HashJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode left,
RelNode right, RexNode condition,
- JoinRelType joinType) throws InvalidRelException {
- this(cluster, traits, left, right, condition, joinType, false, null,
false, JoinControl.DEFAULT);
+ JoinRelType joinType, boolean semiJoin) throws
InvalidRelException {
+ this(cluster, traits, left, right, condition, joinType, false, null,
false, JoinControl.DEFAULT, semiJoin);
+ }
+
+ public HashJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode left,
RelNode right, RexNode condition,
+ JoinRelType joinType, boolean swapped, RuntimeFilterDef
runtimeFilterDef,
+ boolean isRowKeyJoin, int joinControl) throws
InvalidRelException {
+ this(cluster, traits, left, right, condition, joinType, swapped,
runtimeFilterDef, isRowKeyJoin, joinControl, false);
}
public HashJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode left,
RelNode right, RexNode condition,
JoinRelType joinType, boolean swapped, RuntimeFilterDef runtimeFilterDef,
- boolean isRowKeyJoin, int joinControl) throws InvalidRelException {
- super(cluster, traits, left, right, condition, joinType);
+ boolean isRowKeyJoin, int joinControl, boolean semiJoin) throws
InvalidRelException {
+ super(cluster, traits, left, right, condition, joinType, semiJoin);
+ Preconditions.checkArgument(isSemiJoin && !swapped || swapped &&
!isSemiJoin || (!swapped && !isSemiJoin));
Review comment:
Why not simplify to :
`if (isSemiJoin) {`
`Preconditions.checkArgument(!swapped : 'swapping of inputs is not
allowed for semi-joins') `
`}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services