gengliangwang commented on a change in pull request #28805:
URL: https://github.com/apache/spark/pull/28805#discussion_r448143683



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -249,8 +251,36 @@ trait PredicateHelper extends Logging {
     resultStack.top
   }
 
-  private def groupExpressionsByQualifier(expressions: Seq[Expression]): 
Seq[Expression] = {
-    
expressions.groupBy(_.references.map(_.qualifier)).map(_._2.reduceLeft(And)).toSeq
+  /**
+   * Convert an expression to conjunctive normal form when pushing predicates 
through Join,
+   * when expand predicates, we can group by the qualifier avoiding generate 
unnecessary
+   * expression to control the length of final result since there are multiple 
tables.
+   *
+   * @param condition condition need to be converted
+   * @return the CNF result as sequence of disjunctive expressions. If the 
number of expressions
+   *         exceeds threshold on converting `Or`, `Seq.empty` is returned.
+   */
+  def conjunctiveNormalFormAndGroupExpsByQualifier(condition: Expression): 
Seq[Expression] = {

Review comment:
       On second thought, the method name 
`conjunctiveNormalFormAndGroupExpsByQualifier` is too long and the `And` is 
weird.
   How about changing to `CNFWithGroupExpressionsByQualifier`?




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