{"record":{"id":"c59166e43e9d4beb","repo":"databendlabs/databend","slug":"not-implemented-c59166","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/storages/iceberg/src/catalog.rs","lineNumber":328,"sourceCode":"        true\n    }\n\n    fn disable_table_info_refresh(self: Arc<Self>) -> Result<Arc<dyn Catalog>> {\n        Ok(self)\n    }\n\n    #[fastrace::trace]\n    #[async_backtrace::framed]\n    async fn get_database(&self, tenant: &Tenant, db_name: &str) -> Result<Arc<dyn Database>> {\n        let c = self.exists_database(tenant, db_name).await?;\n        if !c {\n            return Err(ErrorCode::UnknownDatabase(db_name.to_string()));\n        }\n        Ok(Arc::new(IcebergDatabase::create(self.clone(), db_name)))\n    }\n\n    async fn list_databases_history(&self, _tenant: &Tenant) -> Result<Vec<Arc<dyn Database>>> {\n        unimplemented!()\n    }\n\n    #[async_backtrace::framed]\n    async fn list_databases(&self, _tenant: &Tenant) -> Result<Vec<Arc<dyn Database>>> {\n        let db_names = self\n            .iceberg_catalog()\n            .list_namespaces(None)\n            .await\n            .map_err(|err| {\n                ErrorCode::Internal(format!(\"Iceberg catalog load database failed: {err:?}\"))\n            })?;\n        let mut dbs = Vec::new();\n        for db_name in db_names {\n            let db = Arc::new(IcebergDatabase::create(\n                self.clone(),\n                &db_name.to_url_string(),\n            )) as Arc<dyn Database>;\n            dbs.push(db);","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/storages/iceberg/src/catalog.rs#L310-L346","documentation":"The Iceberg catalog's `list_databases_history` is an explicit `unimplemented!()` stub. Iceberg catalogs do not expose database drop/undo history, so calling this catalog API panics with 'not implemented'.","triggerScenarios":"Executing `SHOW DATABASES HISTORY` (or any MetaAPI path that calls `list_databases_history`) against a catalog of the Iceberg engine.","commonSituations":"A user runs history/undo queries on an Iceberg-backed database expecting the same behavior as native catalogs; tooling enumerates catalog features generically and hits the stub.","solutions":["Do not run database-history queries against Iceberg catalogs; use `SHOW DATABASES` instead","Add an early check in the query layer that returns a clear 'not supported for iceberg catalog' ErrorCode instead of panicking","Implement the method by delegating to the underlying iceberg catalog's history API if it gains one"],"exampleFix":"// caller side\nif catalog.engine() == \"iceberg\" {\n    return Err(ErrorCode::Unsupported(format!(\"list_databases_history for iceberg catalog {}\", name)));\n}\nlet dbs = catalog.list_databases_history(&tenant).await?;","handlingStrategy":"validation","validationCode":"let supports_history = catalog.as_any().downcast_ref::<IcebergCatalog>().is_none();\nif !supports_history { return Err(\"SHOW DATABASES HISTORY unsupported for iceberg\".into()); }","typeGuard":"fn is_iceberg_catalog(c: &dyn Catalog) -> bool { c.as_any().downcast_ref::<IcebergCatalog>().is_some() }","tryCatchPattern":"match std::panic::catch_unwind(AssertUnwindSafe(|| rt.block_on(catalog.list_databases_history(&tenant)))) {\n    Ok(Ok(dbs)) => dbs,\n    _ => catalog.list_databases(&tenant).await?, // fallback to current listing\n}","preventionTips":["Do not run SHOW DATABASES HISTORY against Iceberg catalogs","Check catalog engine type before calling history/undrop/rename APIs","Track which Catalog trait methods are stubbed for external catalogs and gate features accordingly"],"tags":["rust","iceberg","catalog","unimplemented"],"backgroundTag":"method-not-implemented","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}