LuciferYang commented on code in PR #13710:
URL: https://github.com/apache/gluten/pull/13710#discussion_r4662768138


##########
backends-velox/src/main/scala/org/apache/gluten/execution/HashJoinExecTransformer.scala:
##########
@@ -274,4 +274,37 @@ case class BroadcastHashJoinContext(
         substraitJoinType == JoinRel.JoinType.JOIN_TYPE_LEFT_ANTI
     )
   }
+
+  /**
+   * Identifies the native hash table this join needs from a broadcast 
relation, which every join
+   * reusing the broadcast exchange shares. Joins with the same key can share 
a hash table. For an
+   * anti join, `droppedDuplicates` also tells whether it has a filter.
+   */
+  def hashTableBuildKey: HashTableBuildKey = {
+    // An anti join with a null-intolerant filter leaves out the build rows 
that are null in the
+    // filter's build columns 
(HashTableBuilder::removeInputRowsForAntiJoinFilter). The columns
+    // are given by position: a reused exchange gives them other expression 
IDs.
+    val nullFilteredColumns =
+      if (
+        substraitJoinType == JoinRel.JoinType.JOIN_TYPE_LEFT_ANTI &&
+        hasMixedFiltCondition && filterPropagatesNulls
+      ) {
+        val buildColumns = 
buildSideStructure.map(ConverterUtils.genColumnNameWithExprId)
+        filterBuildColumns.map(buildColumns.indexOf(_)).sorted.distinct.toList
+      } else {
+        Nil
+      }
+    HashTableBuildKey(
+      droppedDuplicates,
+      isNullAwareAntiJoin,
+      nullFilteredColumns,
+      bloomFilterPushdownSize)

Review Comment:
   Agreed on both, dropped in f885abd07. Canonicalizing the broadcast mode 
keeps `isNullAware`, so every join reading one relation has the same value, and 
the bloom filter size only decides whether a filter is built. The key is now 
the dropped-duplicates flag and the null-filtered build columns.
   



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


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

Reply via email to