mihailotim-db commented on code in PR #50010: URL: https://github.com/apache/spark/pull/50010#discussion_r1963043803
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/NaturalAndUsingJoinResolution.scala: ########## @@ -120,13 +124,15 @@ object NaturalAndUsingJoinResolution extends DataTypeErrorsBase with SQLConfHelp private def computeOutputAndHiddenOutput( leftOutput: Seq[Attribute], leftKeys: Seq[Attribute], + leftKeysLookup: AttributeSet, rightOutput: Seq[Attribute], rightKeys: Seq[Attribute], + rightKeysLookup: AttributeSet, joinPairs: Seq[(Attribute, Attribute)], joinType: JoinType): (Seq[NamedExpression], Seq[Attribute]) = { // columns not in joinPairs - val lUniqueOutput = leftOutput.filterNot(att => leftKeys.contains(att)) - val rUniqueOutput = rightOutput.filterNot(att => rightKeys.contains(att)) + val lUniqueOutput = leftOutput.filterNot(att => leftKeysLookup.contains(att)) + val rUniqueOutput = rightOutput.filterNot(att => rightKeysLookup.contains(att)) Review Comment: Yeah, fair point, fixed! -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org