LuciferYang commented on code in PR #58225:
URL: https://github.com/apache/spark/pull/58225#discussion_r3954295207
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala:
##########
@@ -229,6 +229,23 @@ class JDBCTableCatalogSuite extends SharedSparkSession {
}
}
+ test("SPARK-58945: H2 renameTable reports source table when it is missing") {
+ Seq(
+ "not_existing_table" -> "`test`.`not_existing_table`",
+ "PEOPLE" -> "`test`.`PEOPLE`"
Review Comment:
`renameTable` never sees 42103/42104 on H2, so this `PEOPLE` case ends up in
the same branch as the `not_existing_table` case above it. Drop both codes from
the `case` again and the suite still passes. I probed 2.3.232, the version
pinned in `sql/core/pom.xml`: renaming `"test"."PEOPLE"` while
`"test"."people"` exists gives 42102, and so does the same rename against a
database with no tables at all. `AlterTable.update()` resolves through
`findTableOrView` and throws `TABLE_OR_VIEW_NOT_FOUND_1` unconditionally, while
42103 and 42104 come only from the parser's not-found path.
The fold is still right, it is just `alterTable` that reaches it. Its `DROP
COLUMN` and `ALTER COLUMN` do raise 42103, and `alterTable` passes `tableName`,
so the rendering is the one this test already asserts. A separate case outside
this `foreach`, calling `alterTable` with a `TableChange.deleteColumn`, would
cover that. 42104 also needs a database with no user tables anywhere, and the
H2 database this suite builds in `beforeAll` always holds `test.people`, so a
sentence noting that is enough.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]