bersprockets commented on code in PR #52067:
URL: https://github.com/apache/spark/pull/52067#discussion_r2289074225


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/ShuffledHashJoinExec.scala:
##########
@@ -67,12 +67,7 @@ case class ShuffledHashJoinExec(
 
   // Exposed for testing
   @transient lazy val ignoreDuplicatedKey = joinType match {
-    case LeftExistence(_) =>
-      // For building hash relation, ignore duplicated rows with same join 
keys if:
-      // 1. Join condition is empty, or
-      // 2. Join condition only references streamed attributes and build join 
keys.
-      val streamedOutputAndBuildKeys = AttributeSet(streamedOutput ++ 
buildKeys)
-      condition.forall(_.references.subsetOf(streamedOutputAndBuildKeys))
+    case LeftExistence(_) if condition.isEmpty => true

Review Comment:
   @peter-toth 
   
   It's hard for me to grok that traversal, but I think the gist is:
   
   - Any subtree of condition that is not a semantic match to a build-side join 
key must be checked for naughty attributes.
   - Set `valid` to false when we hit a naughty attribute in such a subtree.
   - We can short circuit the traversal once `valid` is set to false.
   
   I wish there was another way to express that, but I don't know how else to 
skip selected subtrees of condition.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to