You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/12/12 12:22:04 UTC

[GitHub] vdiravka commented on a change in pull request #1568: DRILL-6878: Use DrillPushRowKeyJoinToScan rule on DrillJoin pattern to o account for DrillSemiJoin

vdiravka commented on a change in pull request #1568: DRILL-6878: Use DrillPushRowKeyJoinToScan rule on DrillJoin pattern to o account for DrillSemiJoin
URL: https://github.com/apache/drill/pull/1568#discussion_r240958295
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/RowKeyJoinRel.java
 ##########
 @@ -50,20 +66,72 @@ public RowKeyJoinRel(RelOptCluster cluster, RelTraitSet traits, RelNode left, Re
 
   @Override
   public RowKeyJoinRel copy(RelTraitSet traitSet, RexNode condition, RelNode left, RelNode right, JoinRelType joinType,
-      boolean semiJoinDone) {
-    return new RowKeyJoinRel(getCluster(), traitSet, left, right, condition, joinType);
+      boolean semiJoin) {
+    return new RowKeyJoinRel(getCluster(), traitSet, left, right, condition, joinType, semiJoin);
   }
 
   @Override
   public LogicalOperator implement(DrillImplementor implementor) {
     return super.implement(implementor);
   }
 
+  /**
+   * Returns whether this RowKeyJoin represents a {@link org.apache.calcite.rel.core.SemiJoin}
+   * @return true if join represents a {@link org.apache.calcite.rel.core.SemiJoin}, false otherwise.
+   */
+  public boolean isSemiJoin() {
+    return isSemiJoin;
+  }
+
+  @Override
+  public RelDataType deriveRowType() {
+    return SqlValidatorUtil.deriveJoinRowType(
+            left.getRowType(),
+            isSemiJoin() ? null : right.getRowType(),
+            JoinRelType.INNER,
+            getCluster().getTypeFactory(),
+            null,
+            ImmutableList.of());
+  }
+
   public static RowKeyJoinRel convert(Join join, ConversionContext context) throws InvalidRelException {
     Pair<RelNode, RelNode> inputs = getJoinInputs(join, context);
     RexNode rexCondition = getJoinCondition(join, context);
     RowKeyJoinRel joinRel = new RowKeyJoinRel(context.getCluster(), context.getLogicalTraits(),
         inputs.left, inputs.right, rexCondition, join.getJoinType());
     return joinRel;
   }
+
+  @Override public boolean isValid(Litmus litmus, Context context) {
 
 Review comment:
   `both both`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services