{"record":{"id":"73beaf993dddba51","repo":"dbt-labs/dbt-core","slug":"clickhouseadapter-freshness","errorCode":null,"errorMessage":"ClickHouseAdapter::freshness","messagePattern":"ClickHouseAdapter::freshness","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/metadata/clickhouse/mod.rs","lineNumber":272,"sourceCode":"\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\n    fn list_relations_in_parallel_inner(\n        &self,\n        db_schemas: &[CatalogAndSchema],\n        token: CancellationToken,\n    ) -> AsyncAdapterResult<'_, BTreeMap<CatalogAndSchema, AdapterResult<RelationVec>>> {\n        type Acc = BTreeMap<CatalogAndSchema, AdapterResult<RelationVec>>;\n\n        let factory = Box::new(AdapterConnectionFactory::new(","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/metadata/clickhouse/mod.rs#L254-L290","documentation":"ClickHouse's `freshness_inner` is a `todo!()` stub in the metadata trait implementation, so source freshness checks are unimplemented for ClickHouseAdapter. Calling the freshness metadata API panics with 'ClickHouseAdapter::freshness'.","triggerScenarios":"Invoking the metadata freshness API (which dispatches to `freshness_inner`) against a ClickHouse adapter, e.g., when computing freshness of relations via `*_freshness` metadata tables.","commonSituations":"Running source freshness checks in a ClickHouse-configured project; the panic occurs the first time freshness is requested for any relation.","solutions":["Implement `freshness_inner` for ClickHouseAdapter, e.g., reading timestamps from ClickHouse freshness/system tables for the given relations","Skip freshness collection for ClickHouse or gate the freshness flow behind a capability check until implemented","Track the missing feature upstream"],"exampleFix":"// before\nfn freshness_inner(\n    &self,\n    _relations: &[Arc<dyn BaseRelation>],\n    _token: CancellationToken,\n) -> AsyncAdapterResult<'_, BTreeMap<String, MetadataFreshness>> {\n    todo!(\"ClickHouseAdapter::freshness\")\n}\n// after\nfn freshness_inner(\n    &self,\n    relations: &[Arc<dyn BaseRelation>],\n    token: CancellationToken,\n) -> AsyncAdapterResult<'_, BTreeMap<String, MetadataFreshness>> {\n    self.query_freshness(relations, token)\n}","handlingStrategy":"validation","validationCode":"if adapter.name() == \"clickhouse\" {\n    return Err(anyhow!(\"Freshness is not implemented for ClickHouse\"));\n}","typeGuard":"fn supports_freshness(adapter: &dyn Adapter) -> bool {\n    adapter.capabilities().freshness\n}","tryCatchPattern":"match std::panic::catch_unwind(AssertUnwindSafe(|| adapter.freshness(relations))) {\n    Ok(map) => map,\n    Err(_) => BTreeMap::new(),\n}","preventionTips":["Check freshness support per adapter before scheduling freshness runs","Skip freshness collection for adapters without freshness_inner implemented","Surface freshness as 'unknown' instead of calling an unimplemented API","Track upstream ClickHouse freshness support"],"tags":["rust","todo-panic","unimplemented","clickhouse","freshness"],"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"}