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



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
##########
@@ -205,7 +205,7 @@ class HiveCatalogedDDLSuite extends DDLSuite with 
TestHiveSingleton with BeforeA
       spark.sql("CREATE VIEW v AS SELECT STRUCT('a' AS `a`, 1 AS b) q")
       checkAnswer(spark.table("v"), Row(Row("a", 1)) :: Nil)
 
-      spark.sql("ALTER VIEW v AS SELECT STRUCT('a' AS `b`, 1 AS b) q1")
+      spark.sql("ALTER VIEW v AS SELECT STRUCT('a' AS `c`, 1 AS b) q1")

Review comment:
       Ah, I see. Since we don't allow duplicate names in a top-level, it seems 
we need to follow it in this case, too. cc: @cloud-fan 
   ```
   scala> spark.sql("CREATE VIEW v1 AS SELECT 'a' AS `a`, 1 AS b")
   scala> spark.sql("ALTER VIEW v1 AS SELECT 'a' AS `b`, 1 AS b")
   org.apache.spark.sql.AnalysisException: Found duplicate column(s) in the 
view definition: `b`
   ```




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