dongjoon-hyun commented on a change in pull request #31908:
URL: https://github.com/apache/spark/pull/31908#discussion_r598376728



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
##########
@@ -659,6 +659,12 @@ case class Aggregate(
     val nonAgg = 
aggregateExpressions.filter(_.find(_.isInstanceOf[AggregateExpression]).isEmpty)
     getAllValidConstraints(nonAgg)
   }
+
+  // Whether this Aggregate operator is equally the Distinct operator.

Review comment:
       Ur, is this description correct? Technically, `semanticEquals` returns 
`false` for in-deterministic expressions. So, it seems that we miss some 
`Distinct` operators theoretically. It's not a problem for this optimizer's 
functionality, but maybe could you revise this description a little?
   ```
     def semanticEquals(other: Expression): Boolean =
       deterministic && other.deterministic && canonicalized == 
other.canonicalized
   ```

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
##########
@@ -659,6 +659,12 @@ case class Aggregate(
     val nonAgg = 
aggregateExpressions.filter(_.find(_.isInstanceOf[AggregateExpression]).isEmpty)
     getAllValidConstraints(nonAgg)
   }
+
+  // Whether this Aggregate operator is equally the Distinct operator.

Review comment:
       Ur, is this description correct? Technically, `semanticEquals` returns 
`false` for in-deterministic expressions. So, it seems that we miss some 
`Distinct` operators theoretically. It's not a problem for this optimizer's 
functionality, but maybe could you revise this description a little?
   ```scala
     def semanticEquals(other: Expression): Boolean =
       deterministic && other.deterministic && canonicalized == 
other.canonicalized
   ```




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