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 2020/02/21 04:34:57 UTC

[GitHub] [spark] maropu commented on a change in pull request #27651: [SPARK-30903][SQL] Fail fast on duplicate columns when analyze columns

maropu commented on a change in pull request #27651: [SPARK-30903][SQL] Fail fast on duplicate columns when analyze columns
URL: https://github.com/apache/spark/pull/27651#discussion_r382393062
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala
 ##########
 @@ -650,4 +651,17 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared
       }
     }
   }
+
+  test("SPARK-30903: Fail fast on duplicate columns when analyze columns") {
+    val table = "test_table"
+    withTable(table) {
+      sql(s"""
+           |CREATE TABLE $table (value string, name string)
+           |USING PARQUET""".stripMargin)
+      val errorMsg = intercept[ParseException] {
+        sql(s"ANALYZE TABLE $table COMPUTE STATISTICS FOR COLUMNS value, name, name, value")
 
 Review comment:
   I think we need to take care of case-sensitivity and need some tests for that. We can use some methods to check the name duplication in `SchemaUtils`?

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


With regards,
Apache Git Services

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