maropu commented on a change in pull request #31045:
URL: https://github.com/apache/spark/pull/31045#discussion_r552253663



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1612,9 +1612,12 @@ object ConvertToLocalRelation extends Rule[LogicalPlan] {
  * {{{
  *   SELECT DISTINCT f1, f2 FROM t  ==>  SELECT f1, f2 FROM t GROUP BY f1, f2
  * }}}
+ *
+ * The [[Distinct]] can be ignored if it is the right child of a left semi or 
anti join.

Review comment:
       nit: could you move this comment between L1619/L1620?
   ```
   // The [[Distinct]] can be ignored if it is the right child of a left semi 
or anti join.
   case j @ Join(_, Distinct(right), LeftSemiOrAnti(_), _, _) => j.copy(right = 
right)
   ``` 




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to