jaceklaskowski commented on code in PR #40713:
URL: https://github.com/apache/spark/pull/40713#discussion_r1165373103


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala:
##########
@@ -676,19 +676,20 @@ case class WholeStageCodegenExec(child: SparkPlan)(val 
codegenStageId: Int)
           case _: WholeStageCodegenExec =>
           case _: InputRDDCodegen =>
           case c: CodegenSupport =>
-            val (newReusableExpressions, newAttributeSet) = 
c.reusableExpressions()
+            val (newReusableExpressions, newAttributeSeq) = 
c.reusableExpressions()
             // If the input attributes changed, collect current common 
expressions and clear
             // equivalentExpressions
-            if (!attributeSet.subsetOf(newAttributeSet)) {
+            if (attributeSeq.size != newAttributeSeq.size ||
+              attributeSeq.zip(newAttributeSeq).exists(tup => 
!tup._1.equals(tup._2))) {

Review Comment:
   `tup`?! Please no. How about the following:
   
   ```
   exists { case (left, right) => left != right }
   ```
   
   or similar?
   
   I'd also be in favour of creating a helper method to cover this `if` 
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: [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