dbt-labs/dbt-core · error
Datafusion
Error message
Datafusion
What it means
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.
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
Example fix
// before
AdapterType::Datafusion => todo!("Datafusion"),
// after
AdapterType::Datafusion => datafusion_get_relation(
adapter, state, ctx, conn, database, schema, identifier, token,
), Defensive patterns
Strategy: validation
Validate before calling
if matches!(adapter_type, AdapterType::Datafusion) {
return Err("DataFusion get_relation is not implemented yet".into());
} Type guard
fn datafusion_ready(t: &AdapterType) -> bool { !matches!(t, AdapterType::Datafusion) } Try / catch
std::panic::catch_unwind(|| get_relation(...))
.map_err(|_| AdapterError::NotImplemented("DataFusion get_relation"))? Prevention
- 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
When it happens
Trigger: Calling `get_relation` (public) with AdapterType::Datafusion; the arm at crates/dbt-adapter/src/metadata/get_relation.rs:88 executes `todo!("Datafusion")`.
Common situations: 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.
Related errors
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/aa1732ae0ded6689.
Report an issue: GitHub.
Appendix: source
Thrown at crates/dbt-adapter/src/metadata/get_relation.rs:88
}
AdapterType::DuckDB | AdapterType::LakeCompute => duckdb_get_relation(
adapter, state, ctx, conn, database, schema, identifier, token,
),
AdapterType::Fabric => fabric_get_relation(
adapter, state, ctx, conn, database, schema, identifier, token,
),
AdapterType::ClickHouse => clickhouse_get_relation(
adapter, state, ctx, conn, database, schema, identifier, token,
),
AdapterType::Exasol => exasol_get_relation(
adapter, state, ctx, conn, database, schema, identifier, token,
),
AdapterType::Starburst => todo!("Starburst"),
AdapterType::Athena => todo!("Athena"),
AdapterType::Trino => todo!("Trino"),
AdapterType::Dremio => todo!("Dremio"),
AdapterType::Oracle => todo!("Oracle"),
AdapterType::Datafusion => todo!("Datafusion"),
}
}
/// Parses an `INFORMATION_SCHEMA.ROUTINES`-shaped result batch into a
/// [`Relation`].
pub(crate) fn relation_from_routines_batch(
adapter: &AdapterImpl,
database: &str,
schema: &str,
identifier: &str,
batch: &arrow::record_batch::RecordBatch,
) -> AdapterResult<Option<Relation>> {
if batch.num_rows() == 0 {
return Ok(None);
}
let column = batch.column_by_name("table_type").unwrap();
let string_array = column.as_any().downcast_ref::<StringArray>().unwrap();View on GitHub (pinned to 0267ce9170)