@@ -238,13 +238,15 @@ abstract class CometNativeExec extends CometExec {
238238 case (_ : CometBroadcastExchangeExec , _) => false
239239 case (BroadcastQueryStageExec (_, _ : CometBroadcastExchangeExec , _), _) => false
240240 case (BroadcastQueryStageExec (_, _ : ReusedExchangeExec , _), _) => false
241+ case (ReusedExchangeExec (_, _ : CometBroadcastExchangeExec ), _) => false
241242 case _ => true
242243 }
243244
244245 val containsBroadcastInput = sparkPlans.exists {
245246 case _ : CometBroadcastExchangeExec => true
246247 case BroadcastQueryStageExec (_, _ : CometBroadcastExchangeExec , _) => true
247248 case BroadcastQueryStageExec (_, _ : ReusedExchangeExec , _) => true
249+ case ReusedExchangeExec (_, _ : CometBroadcastExchangeExec ) => true
248250 case _ => false
249251 }
250252
@@ -272,16 +274,28 @@ abstract class CometNativeExec extends CometExec {
272274 sparkPlans.zipWithIndex.foreach { case (plan, idx) =>
273275 plan match {
274276 case c : CometBroadcastExchangeExec =>
275- inputs += c.setNumPartitions(firstNonBroadcastPlanNumPartitions).executeColumnar()
277+ inputs += c
278+ .executeColumnar()
279+ .asInstanceOf [CometBatchRDD ]
280+ .withNumPartitions(firstNonBroadcastPlanNumPartitions)
276281 case BroadcastQueryStageExec (_, c : CometBroadcastExchangeExec , _) =>
277- inputs += c.setNumPartitions(firstNonBroadcastPlanNumPartitions).executeColumnar()
282+ inputs += c
283+ .executeColumnar()
284+ .asInstanceOf [CometBatchRDD ]
285+ .withNumPartitions(firstNonBroadcastPlanNumPartitions)
278286 case ReusedExchangeExec (_, c : CometBroadcastExchangeExec ) =>
279- inputs += c.setNumPartitions(firstNonBroadcastPlanNumPartitions).executeColumnar()
287+ inputs += c
288+ .executeColumnar()
289+ .asInstanceOf [CometBatchRDD ]
290+ .withNumPartitions(firstNonBroadcastPlanNumPartitions)
280291 case BroadcastQueryStageExec (
281292 _,
282293 ReusedExchangeExec (_, c : CometBroadcastExchangeExec ),
283294 _) =>
284- inputs += c.setNumPartitions(firstNonBroadcastPlanNumPartitions).executeColumnar()
295+ inputs += c
296+ .executeColumnar()
297+ .asInstanceOf [CometBatchRDD ]
298+ .withNumPartitions(firstNonBroadcastPlanNumPartitions)
285299 case _ : CometNativeExec =>
286300 // no-op
287301 case _ if idx == firstNonBroadcastPlan.get._2 =>
0 commit comments