thswlsqls opened a new issue, #17068: URL: https://github.com/apache/iceberg/issues/17068
**Apache Iceberg version** main @ 49b89a8c5 **Query engine** None — engine-agnostic, view catalog implementations (Glue/Hive/JDBC/InMemory view catalogs) that extend `BaseMetastoreViewCatalog` **Please describe the bug** `BaseMetastoreViewCatalog.loadView(TableIdentifier)` (`core/src/main/java/org/apache/iceberg/view/BaseMetastoreViewCatalog.java` line 56-68) creates a `ViewOperations ops` and calls `ops.current()` to check the view exists, then discards `ops` and calls `newViewOps(identifier)` again to build the returned `BaseView` — reloading view metadata from the metastore a second time for every `loadView()` call. `BaseViewBuilder.create`/`replace` in the same file, and the parent `BaseMetastoreCatalog.loadTable()`, all reuse the `ops` instance used for the existence check instead of creating a new one. **Steps to reproduce** Call `loadView(identifier)` on any `BaseMetastoreViewCatalog` subclass (e.g. `InMemoryCatalog`) for an existing view and count `newViewOps` invocations — it is called twice per `loadView()`, where once would do. **Additional context** Not a correctness bug — the returned `View` is still valid. Fix: reuse the `ops` from the existence check when constructing `BaseView`. -- 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]
