liujiayi771 commented on code in PR #8931:
URL: https://github.com/apache/incubator-gluten/pull/8931#discussion_r2901390455


##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxSparkPlanExecApi.scala:
##########
@@ -678,9 +682,136 @@ class VeloxSparkPlanExecApi extends SparkPlanExecApi {
       child: SparkPlan,
       numOutputRows: SQLMetric,
       dataSize: SQLMetric): BuildSideRelation = {
+
+    val buildKeys = mode match {
+      case mode1: HashedRelationBroadcastMode =>
+        mode1.key
+      case _ =>
+        // IdentityBroadcastMode
+        Seq.empty
+    }
+    var offload = true
+    val (newChild, newOutput, newBuildKeys) =
+      if (VeloxConfig.get.enableBroadcastBuildOncePerExecutor) {
+
+        // Try to lookup from TreeNodeTag using child's logical plan
+        // Need to recursively find logicalLink in case of AQE or other 
wrappers
+        @scala.annotation.tailrec
+        def findLogicalLink(
+            plan: SparkPlan): 
Option[org.apache.spark.sql.catalyst.plans.logical.LogicalPlan] = {
+          plan.logicalLink match {
+            case some @ Some(_) => some
+            case None =>
+              plan.children match {
+                case Seq(child) => findLogicalLink(child)
+                case _ => None
+              }
+          }
+        }
+
+        val newBuildKeys = findLogicalLink(child)
+          .flatMap(_.getTagValue(JoinKeysTag.ORIGINAL_JOIN_KEYS))

Review Comment:
   What is the difference between original join keys and build keys in the mode?



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