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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to