{"record":{"id":"310899394cea1bb7","repo":"dbt-labs/dbt-core","slug":"clickhouseadapter-list-relations-schemas-by-patte","errorCode":null,"errorMessage":"ClickHouseAdapter::list_relations_schemas_by_patterns","messagePattern":"ClickHouseAdapter::list_relations_schemas_by_patterns","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/metadata/clickhouse/mod.rs","lineNumber":264,"sourceCode":"                        schema: AdapterResult<Arc<Schema>>|\n         -> Result<(), Cancellable<AdapterError>> {\n            let (semantic_fqn, _sql_name) = key;\n            // Insert under the semantic FQN so callers using `schemas.get(&relation.semantic_fqn())`\n            // can find the entry.\n            acc.insert(semantic_fqn, schema);\n            Ok(())\n        };\n\n        let map_reduce = MapReduce::new(factory, Box::new(map_f), Box::new(reduce_f), None);\n        map_reduce.run(Arc::new(keys), token)\n    }\n\n    fn list_relations_schemas_by_patterns_inner(\n        &self,\n        _patterns: &[RelationPattern],\n        _token: CancellationToken,\n    ) -> AsyncAdapterResult<'_, Vec<(String, AdapterResult<RelationSchemaPair>)>> {\n        todo!(\"ClickHouseAdapter::list_relations_schemas_by_patterns\")\n    }\n\n    fn freshness_inner(\n        &self,\n        _relations: &[Arc<dyn BaseRelation>],\n        _token: CancellationToken,\n    ) -> AsyncAdapterResult<'_, BTreeMap<String, MetadataFreshness>> {\n        todo!(\"ClickHouseAdapter::freshness\")\n    }\n\n    fn create_schemas_if_not_exists(\n        &self,\n        state: &State<'_, '_>,\n        catalog_schemas: Vec<(String, String, String)>,\n    ) -> AdapterResult<Vec<(String, String, String, AdapterResult<()>)>> {\n        create_schemas_if_not_exists(&self.adapter, self, state, catalog_schemas)\n    }\n","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/metadata/clickhouse/mod.rs#L246-L282","documentation":"ClickHouse's `list_relations_schemas_by_patterns_inner` is a `todo!()` placeholder, so pattern-based relation/schema listing is not implemented for ClickHouseAdapter. Calling the corresponding metadata API panics with the message 'ClickHouseAdapter::list_relations_schemas_by_patterns'.","triggerScenarios":"Invoking `list_relations_schemas_by_patterns` (or any caller that dispatches into this inner method) while connected via the ClickHouse adapter.","commonSituations":"A ClickHouse project triggers a bulk schema refresh or relations cache rebuild that uses the pattern-based listing API; the panic fires the first time that flow runs.","solutions":["Implement the method for ClickHouseAdapter, e.g., querying `system.tables`/`system.columns` filtered by the patterns","Fall back to per-database/per-relation metadata calls that are implemented for ClickHouse","Track the missing feature upstream"],"exampleFix":"// before\nfn list_relations_schemas_by_patterns_inner(\n    &self,\n    _patterns: &[RelationPattern],\n    _token: CancellationToken,\n) -> AsyncAdapterResult<'_, Vec<(String, AdapterResult<RelationSchemaPair>)>> {\n    todo!(\"ClickHouseAdapter::list_relations_schemas_by_patterns\")\n}\n// after\nfn list_relations_schemas_by_patterns_inner(\n    &self,\n    patterns: &[RelationPattern],\n    token: CancellationToken,\n) -> AsyncAdapterResult<'_, Vec<(String, AdapterResult<RelationSchemaPair>)>> {\n    self.query_system_tables_by_patterns(patterns, token)\n}","handlingStrategy":"validation","validationCode":"if adapter.name() == \"clickhouse\" {\n    return Err(anyhow!(\"Pattern-based relation listing is not implemented for ClickHouse\"));\n}","typeGuard":"fn supports_pattern_listing(adapter: &dyn Adapter) -> bool {\n    adapter.capabilities().list_relations_schemas_by_patterns\n}","tryCatchPattern":"match std::panic::catch_unwind(AssertUnwindSafe(|| adapter.list_relations_schemas_by_patterns(patterns))) {\n    Ok(res) => res,\n    Err(_) => per_relation_listing_fallback(patterns),\n}","preventionTips":["Verify ClickHouse pattern-listing support before invoking the bulk API","Use system-table-based custom queries for ClickHouse schema discovery","Gate bulk refresh flows on adapter capabilities","Track upstream ClickHouse metadata implementation"],"tags":["rust","todo-panic","unimplemented","clickhouse","metadata"],"backgroundTag":"method-not-implemented","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}