dbt-labs/dbt-core · error
Datafusion
Error message
Datafusion
What it means
A `todo!()` panic in `ColumnBuilder::build` (column_builder.rs:41) for the Datafusion adapter. The adapter dispatch has no Datafusion column-builder implementation, so schema-to-Column conversion with Datafusion panics with the message 'Datafusion'.
Source
Thrown at crates/dbt-adapter/src/column/column_builder.rs:41
pub fn build(&self, field: &FieldRef, type_ops: &dyn TypeOps) -> AdapterResult<Column> {
use AdapterType::*;
match self.adapter_type {
Snowflake => Ok(Self::build_snowflake(field, type_ops)),
Bigquery => Ok(Self::build_bigquery(field, type_ops)),
Databricks | Spark => Ok(Self::build_databricks(field, type_ops)),
Redshift => Ok(Self::build_redshift(field, type_ops)),
Postgres | Salesforce | DuckDB | LakeCompute => {
Ok(Self::build_postgres_like(field, type_ops))
}
Fabric => Ok(Self::build_fabric(field, type_ops)),
ClickHouse => Self::build_clickhouse(field, type_ops),
Exasol => Ok(Self::build_exasol(field, type_ops)),
Starburst => todo!("Starburst"),
Athena => todo!("Athena"),
Trino => todo!("Trino"),
Dremio => todo!("Dremio"),
Oracle => todo!("Oracle"),
Datafusion => todo!("Datafusion"),
}
}
pub fn build_from_parts(
&self,
name: String,
dtype: String,
char_size: Option<u32>,
numeric_precision: Option<u64>,
numeric_scale: Option<u64>,
mode: Option<BigqueryColumnMode>,
) -> Column {
use AdapterType::*;
match self.adapter_type {
Postgres => Column::new(
Postgres,
name,
dtype,View on GitHub (pinned to 0267ce9170)
Solutions
- Use a supported adapter (Postgres-like, Fabric, ClickHouse, Exasol) until Datafusion is wired up.
- Implement the Datafusion arm by delegating to `build_postgres_like` — Datafusion types are Arrow-native and map closely to the postgres_like path.
- Convert the panic into a typed unsupported-adapter error.
Example fix
// before
Datafusion => todo!("Datafusion"),
// after
Datafusion => Ok(Self::build_postgres_like(field, type_ops)), Defensive patterns
Strategy: type-guard
Validate before calling
if adapter == AdapterType::Datafusion {
return Err(anyhow!("Datafusion column building is not implemented yet"));
} Type guard
fn build_supported(t: AdapterType) -> bool {
matches!(t, Postgres | Salesforce | DuckDB | LakeCompute | Fabric | ClickHouse | Exasol)
} Try / catch
std::panic::catch_unwind(AssertUnwindSafe(|| builder.build(field, type_ops)))
.map_err(|_| anyhow!("column building unimplemented for Datafusion"))? Prevention
- Check ColumnBuilder::build arms before running column metadata extraction with Datafusion
- Delegate Datafusion to build_postgres_like when contributing support (Arrow-native types)
- Add adapter-coverage tests that force every variant through the builder
- Convert todo!() arms to clean errors for fail-fast but catchable behavior
When it happens
Trigger: Any call into ColumnBuilder::build (schema_to_columns, get_column_schema_from_query, update_node_columns) while the adapter type is Datafusion — e.g. introspecting the schema of a local/Arrow-backed query result.
Common situations: Using the embedded Datafusion engine for testing or local execution and then requesting column metadata from results; also hit by tests iterating all adapter variants.
Related errors
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/36d7bd4ad997512a.
Report an issue: GitHub.