cloud-fan commented on code in PR #40662: URL: https://github.com/apache/spark/pull/40662#discussion_r1159196687
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/DeduplicateRelations.scala: ########## @@ -25,18 +25,12 @@ import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.sql.catalyst.trees.TreePattern._ /** - * A helper class used to detect duplicate relations fast in `DeduplicateRelations` + * A helper class used to detect duplicate relations fast in `DeduplicateRelations`. Two relations + * are duplicated if: + * 1. they are the same class. + * 2. they have the same output attribute IDs. Review Comment: CTE ref node has the same output attribute IDs as the CTE def node, and they are not duplicated. Maybe I should put it in the document as well. Otherwise, I can't think of any case that 2 relations of different classes have the same output attribute IDs. -- 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]
