Repository navigation
Hive: Preserve tables and views on mismatched drops - #18691
Conversation
HiveCatalog.dropTable with purge=false dropped an Iceberg view and returned true, because HMS drop_table does not distinguish tables from views. With purge=true the same call threw NoSuchTableException. Return false in both cases, matching the Catalog.dropTable contract and the other catalogs. Closes apache#17278
Move both purge cases into ViewCatalogTests. Hive, JDBC, in-memory and REST pass; temporarily disable the inherited Nessie case pending the separate fix in apache#18912. Generated-by: Codex
|
@binarybrain-009: Are you a human, could you please review the changes? |
|
@pvary I've personally reviewed the current changes, including the shared test and the Nessie follow-up, and updated the human-review disclosure. Thanks for taking another look. |
binarybrain-009
left a comment
There was a problem hiding this comment.
Yeah I am a real human lol I have reviewed it. But with AI tools most of the responses and code is AI generated lol but yeah I review it but yeah updated disclosure etc
Generated-by: Codex
|
@pvary Addressed in 65bfafc. Renamed the shared test to dropTableThatAlreadyExistsAsView and added a loadView check against the original UUID. Added dropViewThatAlreadyExistsAsTable with the same preservation check for tables. That exposed Hive throwing NoSuchViewException for this case, so dropView now returns false. The shared cases pass for Hive, JDBC, in-memory and both REST configurations, and the Hive and Nessie view suites and formatting/checkstyle checks pass. Both Nessie mismatch tests are temporarily disabled pending #18912, which now fixes both directions. Could you take another look? These latest follow-ups were generated with Codex and are marked as awaiting my personal review in the disclosure. |
|
addressed the reivew comments and reviewed as a human |
|
Merged to main. |
HiveCatalog.dropTable(view, false)drops an Iceberg view and returnstrue, because HMSdrop_tabledoes not distinguish tables from views; withpurge=truethe same call throwsNoSuchTableException. This returnsfalsein both cases when the identifier is an Iceberg view, matching theCatalog.dropTablecontract and the in-memory, JDBC and REST catalogs. The guard reusesviewExists, asregisterTableandrenameTabledo, sodropTablenow makes one extra HMSgetTablecall. Non-Iceberg Hive views and tables are still dropped as before. The reverse operation,dropViewat an Iceberg table identifier, now also returnsfalseinstead of throwingNoSuchViewException. This refreshes the stale #17279 by @thswlsqls.Closes #17278
Test plan: Shared catalog tests cover both purge settings for
dropTableat a view identifier, anddropViewat a table identifier. They verify the original object remains loadable with the same UUID. The new tests pass for Hive, JDBC, in-memory and both REST configurations; the Hive and Nessie view suites and formatting/checkstyle checks also pass. Nessie's inherited mismatch tests are temporarily disabled pending #18912.AI Disclosure