maropu commented on a change in pull request #29585:
URL: https://github.com/apache/spark/pull/29585#discussion_r484886465



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
##########
@@ -203,3 +203,58 @@ abstract class BinaryNode extends LogicalPlan {
 abstract class OrderPreservingUnaryNode extends UnaryNode {
   override final def outputOrdering: Seq[SortOrder] = child.outputOrdering
 }
+
+object LogicalPlanIntegrity {
+
+  private def canGetOutputAttrs(p: LogicalPlan): Boolean = {
+    p.resolved && !p.expressions.exists { e =>
+      e.collectFirst {
+        // We cannot call `output` in plans with a `ScalarSubquery` expr 
having no column,
+        // so, we filter out them in advance.

Review comment:
       Some existing tests failed with the assertion below;
   
https://github.com/apache/spark/blob/e7d9a245656655e7bb1df3e04df30eb3cc9e23ad/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala#L229
   




----------------------------------------------------------------
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]

Reply via email to