cloud-fan commented on a change in pull request #32832:
URL: https://github.com/apache/spark/pull/32832#discussion_r657623564



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
##########
@@ -534,6 +535,14 @@ object ViewHelper extends SQLConfHelper with Logging {
     }
   }
 
+  def verifyAutoGeneratedAliasesNotExists(child: LogicalPlan, name: 
TableIdentifier): Unit = {
+    child.expressions.foreach {

Review comment:
       We should check `child.output`, instead of expressions. e.g.
   ```
   SELECT * FROM (SELECT a + b FROM t)
   ```
   
   The root plan here is a `Project` with `AttributeReference` only, and the 
check here can't catch it.




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to