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

 ##########
 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:
   Make sense about case-sensitivity.
   
   And it seems like we may could reuse `checkColumnNameDuplication` in 
`SchemaUtils` but needs slightly change since we'd expect `ParseException` here 
rather than `AnalysisException`.

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