JingDas commented on code in PR #3264:
URL: https://github.com/apache/calcite/pull/3264#discussion_r1239146276


##########
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java:
##########
@@ -128,21 +141,20 @@ public ProjectJoinRemoveRule(
 
     BooleanSupplier isLeftSideReserved = () -> isLeftJoin || (isInnerJoin && 
onlyUseLeft);
     final List<Integer> joinKeys = isLeftSideReserved.getAsBoolean() ? 
rightKeys : leftKeys;
-    if (!Boolean.TRUE.equals(
+    if (Boolean.FALSE.equals(
         mq.areColumnsUnique(isLeftSideReserved.getAsBoolean() ? 
join.getRight() : join.getLeft(),
             ImmutableBitSet.of(joinKeys)))) {
       return;
     }
 
     RelNode node;
     if (isLeftSideReserved.getAsBoolean()) {
-      node = project
-          .copy(project.getTraitSet(), join.getLeft(), project.getProjects(),
-              project.getRowType());
+      node =
+          project.copy(project.getTraitSet(), join.getLeft(),
+              project.getProjects(), project.getRowType());

Review Comment:
   I think you are right, I agree with you. 
   This newline operation is edited by check style.
   After run `./gradlew autostyleApply`, The `project` will go to the next 
line. 
   When I give it a try that moving the `project` in the same row. When run 
`./gradlew build`
   Then it says that the following files have format violations.
   `core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
         @@ -148,14 +148,14 @@
          
              RelNode node;
              if (isLeftSideReserved) {
         -······node·=·project.copy(project.getTraitSet(),␊
         
-··········join.getLeft(),·project.getProjects(),·project.getRowType());␊
         +······node·=␊
         
+··········project.copy(project.getTraitSet(),·join.getLeft(),·project.getProjects(),·project.getRowType());␊
              } else {
                final List<RexNode> newExprs = project.getProjects().stream()
                    .map(expr -> RexUtil.shift(expr, -leftFieldsNum))
                    .collect(Collectors.toList());
         -······node·=·project.copy(project.getTraitSet(),␊
         -··········join.getRight(),·newExprs,·project.getRowType());␊
         +······node·=␊
         
+··········project.copy(project.getTraitSet(),·join.getRight(),·newExprs,·project.getRowType());␊
              }
              call.transformTo(node);
            }
     Run './gradlew autostyleApply' to fix the violations.
   `



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to