huaxingao commented on a change in pull request #30041:
URL: https://github.com/apache/spark/pull/30041#discussion_r505202940



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala
##########
@@ -272,10 +274,12 @@ class JDBCTableCatalogSuite extends QueryTest with 
SharedSparkSession {
 
   test("alter table ... update column nullability") {
     withTable("h2.test.alt_table") {
-      sql("CREATE TABLE h2.test.alt_table (ID INTEGER NOT NULL) USING _")
+      sql("CREATE TABLE h2.test.alt_table (ID INTEGER NOT NULL, deptno INTEGER 
NOT NULL) USING _")

Review comment:
       Without fix (with unquoted column name), this throws the following 
Exception:
   ```
   Failed table altering: test.alt_table;
   org.apache.spark.sql.AnalysisException: Failed table altering: 
test.alt_table;
        at 
org.apache.spark.sql.jdbc.JdbcDialect.classifyException(JdbcDialects.scala:268)
     Caused by: org.h2.jdbc.JdbcSQLException: Column "DEPTNO" not found; SQL 
statement:
   ALTER TABLE "test"."alt_table" ALTER COLUMN deptno SET NULL [42122-195]
   ```




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

Reply via email to