You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zizon (via GitHub)" <gi...@apache.org> on 2025/10/15 10:36:44 UTC

Re: [PR] [SPARK-51692][SQL]Fix bug while replace cte ref which contains dynamicpruning [spark]

zizon commented on PR #50490:
URL: https://github.com/apache/spark/pull/50490#issuecomment-3405770302

   I come across similar issues.
   
   I suspected the root case is in https://github.com/apache/spark/blob/9e14f5f959d4abba4d713a4165d97b59c431123c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/DynamicPruning.scala#L61
   
   The `withNewPlan` do not update the `buildKeys` which latter used to build joins of the `buildQuery` side.
   
   Update paths do not latter resolve such mismatch in a specialize way, but for general `SubqueryExpression`:
   https://github.com/apache/spark/blob/9e14f5f959d4abba4d713a4165d97b59c431123c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/ReplaceCTERefWithRepartition.scala#L81-L87
   
   So, I propose to fix as in this [commit](https://github.com/zizon/spark/commit/990ef227b3f6e70bbd0f12b713eeec261b2655da)


-- 
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-unsubscribe@spark.apache.org

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


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