You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/07/17 07:42:11 UTC
[I] Hive: dropTable silently drops an Iceberg view [iceberg]
thswlsqls opened a new issue, #17278:
URL: https://github.com/apache/iceberg/issues/17278
**Apache Iceberg version**
main @ 8550723a7
**Query engine**
None — the bug is in `HiveCatalog` and is engine-agnostic.
**Please describe the bug**
`HiveCatalog.dropTable(identifier, false)` does not check whether the identifier refers to an Iceberg view, so it silently drops the view and returns `true` (`HiveCatalog.java` line 240-289). The only view check is `ops.current()`, which sits inside the `if (purge)` branch, so `purge=false` reaches `client.dropTable(...)` unvalidated. HMS `drop_table` does not distinguish tables from views.
This breaks the `Catalog.dropTable` contract: "true if the table was dropped, false if the table did not exist" (`api/.../catalog/Catalog.java` line 305). A view is not a table.
It is inconsistent within the class too: `tableExists(viewId)` returns `false`, yet `dropTable(viewId, false)` drops that view. `registerTable` (line 943-949) and both builders already guard against table/view confusion; `dropTable` is the only path missing it.
`InMemoryCatalog`, `JdbcCatalog`, and REST already return `false` here; HiveCatalog is the only catalog affected.
**Steps to reproduce**
1. Create an Iceberg view `v` via `HiveCatalog`.
2. Call `catalog.dropTable(v, false)`.
Expected: returns `false`, view survives.
Actual: returns `true`, the view is gone.
With `purge=true` the same call instead propagates `NoSuchTableException`, so behavior splits on the `purge` flag.
**Additional context**
N/A
--
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: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Hive: dropTable silently drops an Iceberg view [iceberg]
Posted by "pvary (via GitHub) via issues" <is...@iceberg.apache.org>.
pvary closed issue #17278: Hive: dropTable silently drops an Iceberg view
URL: https://github.com/apache/iceberg/issues/17278
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Hive: dropTable silently drops an Iceberg view [iceberg]
Posted by "binarybrain-009 (via GitHub)" <gi...@apache.org>.
binarybrain-009 commented on issue #17278:
URL: https://github.com/apache/iceberg/issues/17278#issuecomment-6499060881
#17279 by @thswlsqls was moved to draft in July, closed by the stale bot in August without a review, and its branch was deleted in September. @thswlsqls, if you'd like to continue it, I'll step aside; otherwise I'd like to pick this up and credit your work. The plan is to have `HiveCatalog.dropTable` return `false` for an Iceberg view, for both `purge` values, using the same `viewExists` check that `registerTable` already uses.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org