{"record":{"id":"aa1732ae0ded6689","repo":"dbt-labs/dbt-core","slug":"datafusion-aa1732","errorCode":null,"errorMessage":"Datafusion","messagePattern":"Datafusion","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/metadata/get_relation.rs","lineNumber":88,"sourceCode":"        }\n        AdapterType::DuckDB | AdapterType::LakeCompute => duckdb_get_relation(\n            adapter, state, ctx, conn, database, schema, identifier, token,\n        ),\n        AdapterType::Fabric => fabric_get_relation(\n            adapter, state, ctx, conn, database, schema, identifier, token,\n        ),\n        AdapterType::ClickHouse => clickhouse_get_relation(\n            adapter, state, ctx, conn, database, schema, identifier, token,\n        ),\n        AdapterType::Exasol => exasol_get_relation(\n            adapter, state, ctx, conn, database, schema, identifier, token,\n        ),\n        AdapterType::Starburst => todo!(\"Starburst\"),\n        AdapterType::Athena => todo!(\"Athena\"),\n        AdapterType::Trino => todo!(\"Trino\"),\n        AdapterType::Dremio => todo!(\"Dremio\"),\n        AdapterType::Oracle => todo!(\"Oracle\"),\n        AdapterType::Datafusion => todo!(\"Datafusion\"),\n    }\n}\n\n/// Parses an `INFORMATION_SCHEMA.ROUTINES`-shaped result batch into a\n/// [`Relation`].\npub(crate) fn relation_from_routines_batch(\n    adapter: &AdapterImpl,\n    database: &str,\n    schema: &str,\n    identifier: &str,\n    batch: &arrow::record_batch::RecordBatch,\n) -> AdapterResult<Option<Relation>> {\n    if batch.num_rows() == 0 {\n        return Ok(None);\n    }\n\n    let column = batch.column_by_name(\"table_type\").unwrap();\n    let string_array = column.as_any().downcast_ref::<StringArray>().unwrap();","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/metadata/get_relation.rs#L70-L106","documentation":"This is a Rust `todo!()` panic: `get_relation` has no DataFusion implementation, so resolving a relation with a DataFusion adapter reaches `todo!(\"Datafusion\")` and panics. The AdapterType variant exists but its metadata lookup was never written, so any use panics deterministically.","triggerScenarios":"Calling `get_relation` (public) with AdapterType::Datafusion; the arm at crates/dbt-adapter/src/metadata/get_relation.rs:88 executes `todo!(\"Datafusion\")`.","commonSituations":"Using dbt with an embedded DataFusion engine (e.g. local Parquet/Arrow workloads) before DataFusion relation resolution exists; the panic fires during relation existence checks.","solutions":["Use a supported adapter type until DataFusion get_relation is implemented","Implement a datafusion_get_relation that inspects the DataFusion catalog provider and add it to the match arm","Pin to a dbt-adapter release that implements the DataFusion arm","Add a startup capability check so DataFusion users get a clear unsupported-adapter error instead of a panic"],"exampleFix":"// before\nAdapterType::Datafusion => todo!(\"Datafusion\"),\n// after\nAdapterType::Datafusion => datafusion_get_relation(\n    adapter, state, ctx, conn, database, schema, identifier, token,\n),","handlingStrategy":"validation","validationCode":"if matches!(adapter_type, AdapterType::Datafusion) {\n    return Err(\"DataFusion get_relation is not implemented yet\".into());\n}","typeGuard":"fn datafusion_ready(t: &AdapterType) -> bool { !matches!(t, AdapterType::Datafusion) }","tryCatchPattern":"std::panic::catch_unwind(|| get_relation(...))\n    .map_err(|_| AdapterError::NotImplemented(\"DataFusion get_relation\"))?","preventionTips":["Confirm DataFusion support scope before embedding it as an adapter","Validate adapter capabilities at session start","Keep todo!() arms surfaced via CI checks","Fall back to a supported engine until the DataFusion arm ships"],"tags":["rust","todo-panic","adapter","unimplemented"],"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-17T15:17:12.973Z"}