{"record":{"id":"cd2a3b5698b8d13a","repo":"apache/iceberg","slug":"doesn-t-support-initialization","errorCode":null,"errorMessage":" doesn't support initialization","messagePattern":" doesn't support initialization","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/catalog/BaseViewSessionCatalog.java","lineNumber":93,"sourceCode":"\n    @Override\n    public void renameView(TableIdentifier from, TableIdentifier to) {\n      BaseViewSessionCatalog.this.renameView(context, from, to);\n    }\n\n    @Override\n    public void invalidateView(TableIdentifier identifier) {\n      BaseViewSessionCatalog.this.invalidateView(context, identifier);\n    }\n\n    @Override\n    public View registerView(TableIdentifier identifier, String metadataFileLocation) {\n      return BaseViewSessionCatalog.this.registerView(context, identifier, metadataFileLocation);\n    }\n\n    @Override\n    public void initialize(String name, Map<String, String> properties) {\n      throw new UnsupportedOperationException(\n          this.getClass().getSimpleName() + \" doesn't support initialization\");\n    }\n  }\n}\n","sourceCodeStart":75,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/catalog/BaseViewSessionCatalog.java#L75-L98","documentation":"BaseViewSessionCatalog's wrapped ViewSessionCatalog context object does not support the initialize lifecycle method; calling initialize on it throws UnsupportedOperationException with the class name. Initialization is meant for the underlying catalog, not this session-catalog adapter.","triggerScenarios":"Calling initialize(name, properties) on a BaseViewSessionCatalog view-context wrapper obtained via asViewCatalog or similar adapter.","commonSituations":"Framework code (e.g. engine catalog initialization hooks) uniformly calling initialize on any catalog object without checking adapter support.","solutions":["Call initialize on the underlying catalog implementation, not the session-catalog view wrapper","Initialize the BaseViewSessionCatalog itself before obtaining view contexts","Guard with a capability check before calling initialize on unknown catalog types"],"exampleFix":"// before\nviewSessionCatalog.initialize(name, props);\n// after\nbaseViewSessionCatalog.asCatalog().initialize(name, props); // init the real catalog","handlingStrategy":"type-guard","validationCode":"if (catalog instanceof BaseViewSessionCatalog.ViewSessionCatalog) { /* adapter does not support initialize */ }","typeGuard":"boolean supportsInitialize(Catalog c) { return !(c instanceof BaseViewSessionCatalog.ViewSessionCatalog); }","tryCatchPattern":"try { viewCtx.initialize(name, props); } catch (UnsupportedOperationException e) { /* initialize the underlying catalog instead */ }","preventionTips":["Initialize catalogs before extracting view contexts","Do not treat adapter wrappers as full Catalog implementations","Check capability before calling lifecycle methods on catalog objects"],"tags":["catalog","unsupported-operation","initialization"],"backgroundTag":"method-not-implemented","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}