jzc928 commented on a change in pull request #29761:
URL: https://github.com/apache/spark/pull/29761#discussion_r489331765
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
##########
@@ -2242,6 +2242,29 @@ abstract class SQLQuerySuiteBase extends QueryTest with
SQLTestUtils with TestHi
}
}
+ test("SPARK-32889 ORC table column name supports special characters like $
eg.") {
+ Seq("$").foreach { name =>
+ Seq("ORC").foreach { source =>
+ withSQLConf("spark.sql.orc.column.allowSpecialChar" -> "true") {
+ Seq(s"CREATE TABLE t32889(`col$name` INT) USING $source",
+ s"CREATE TABLE t32889 STORED AS $source AS SELECT 1 `col$name`",
+ s"CREATE TABLE t32889 USING $source AS SELECT 1 `col$name`",
+ s"CREATE TABLE t32889(`col$name` INT) USING hive OPTIONS
(fileFormat '$source')")
+ .foreach { command =>
+ withTable("t32889") {
+ sql(command)
+ }
+ }
+
+ withTable("t32889") {
+ sql(s"CREATE TABLE t32889(`col` INT) USING $source")
+ sql(s"ALTER TABLE t32889 ADD COLUMNS(`col$name` INT)")
Review comment:
it's about col name check in alter command. so i add here together.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]