You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/25 02:11:11 UTC

[GitHub] [spark] maropu commented on a change in pull request #31639: [SPARK-34528][SQL] Named explicitly field in struct of a view

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



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