maropu commented on a change in pull request #29585:
URL: https://github.com/apache/spark/pull/29585#discussion_r482588081
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
##########
@@ -203,3 +203,28 @@ abstract class BinaryNode extends LogicalPlan {
abstract class OrderPreservingUnaryNode extends UnaryNode {
override final def outputOrdering: Seq[SortOrder] = child.outputOrdering
}
+
+object LogicalPlanIntegrity {
Review comment:
Ah, I see. Nice suggestion. Looked around the related code, I think it
is not easy to catch all the ill-formed case as you said, but IMO most common
patterns to cause duplicate `ExprId`s are a reuse of the `ExprId`s of
references, e.g., `a#1 + 1 as a#1` as you pointed above. So, how about just
checking this reuse pattern in the plan integrity check?
https://github.com/apache/spark/pull/29585/files#diff-27c76f96a7b2733ecfd6f46a1716e153R238
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]