yaooqinn commented on code in PR #45180: URL: https://github.com/apache/spark/pull/45180#discussion_r1496768986
########## sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala: ########## @@ -2876,22 +2876,22 @@ class HiveDDLSuite } } - test("SPARK-24681 checks if nested column names do not include ',', ':', and ';'") { - Seq("nested,column", "nested:column", "nested;column").foreach { nestedColumnName => + test("SPARK-47101 checks if nested column names do not include invalid characters") { + Seq(",", ";", "^", "\\", "/", "%").foreach { c => + val typ = s"array<struct<`abc${c}xyz`:int>>" + val replaced = typ.replaceAll("`", "") withTable("t") { + val msg = s"Error: : expected at the position 16 of '$replaced' but '$c' is found." checkError( exception = intercept[AnalysisException] { - spark.range(1) - .select(struct(lit(0).as(nestedColumnName)).as("toplevel")) - .write - .format("hive") - .saveAsTable("t") + sql(s"CREATE TABLE t (a $typ) USING hive") }, - errorClass = "INVALID_HIVE_COLUMN_NAME", + errorClass = "INVALID_HIVE_COLUMN_TYPE", parameters = Map( - "invalidChars" -> "',', ':', ';'", + "detailMessage" -> msg, Review Comment: Thank you for the information -- 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