LuciferYang commented on code in PR #38685: URL: https://github.com/apache/spark/pull/38685#discussion_r1029979036
########## sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala: ########## @@ -1759,24 +1763,25 @@ class DataFrameSuite extends QueryTest test("SPARK-8072: Better Exception for Duplicate Columns") { // only one duplicate column present - val e = intercept[org.apache.spark.sql.AnalysisException] { + val e = intercept[AnalysisException] { Seq((1, 2, 3), (2, 3, 4), (3, 4, 5)).toDF("column1", "column2", "column1") .write.format("parquet").save("temp") } - assert(e.getMessage.contains("Found duplicate column(s) when inserting into")) - assert(e.getMessage.contains("column1")) - assert(!e.getMessage.contains("column2")) + checkError( + exception = e, + errorClass = "COLUMN_ALREADY_EXISTS", + parameters = Map("columnName" -> "`column1`")) Review Comment: Let me check this -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org