cloud-fan commented on code in PR #41763:
URL: https://github.com/apache/spark/pull/41763#discussion_r1345269790
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala:
##########
@@ -325,6 +326,61 @@ object LogicalPlanIntegrity {
LogicalPlanIntegrity.hasUniqueExprIdsForOutput(plan))
}
+ /**
+ * This method validates there are no dangling attribute references.
+ * Returns an error message if the check does not pass, or None if it does
pass.
+ */
+ def validateNoDanglingReferences(plan: LogicalPlan): Option[String] = {
+ plan.collectFirst {
+ // DML commands and multi instance relations (like InMemoryRelation
caches)
+ // have different output semantics than typical queries.
Review Comment:
Do we really need to special-case these two? `QueryPlan#missingInputs`
should have already taken care of them
```
final def missingInput: AttributeSet = references -- inputSet
```
--
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]