dbt-labs/dbt-core · critical

Trino

Error message

Trino

What it means

This is a Rust `todo!()` panic: selecting a metadata adapter for the Trino adapter type is not yet implemented. The match arm in `metadata_adapter` in crates/dbt-adapter/src/adapter/adapter_impl.rs:318-323 has no adapter class for Starburst/Athena/Trino/Datafusion/Dremio/Oracle, so reaching the Trino arm aborts the process with a panic whose payload is the message "Trino". It signals an incomplete feature, not a runtime misconfiguration by the caller.

Source

Thrown at crates/dbt-adapter/src/adapter/adapter_impl.rs:320

                        Postgres => Box::new(PostgresMetadataAdapter::new(engine))
                            as Box<dyn MetadataAdapter>,
                        DuckDB => {
                            Box::new(DuckDBMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>
                        }
                        LakeCompute => {
                            Box::new(DuckDBMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>
                        }
                        Fabric => {
                            Box::new(FabricMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>
                        }
                        ClickHouse => Box::new(ClickHouseMetadataAdapter::new(engine))
                            as Box<dyn MetadataAdapter>,
                        Exasol => {
                            Box::new(ExasolMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>
                        }
                        Starburst => todo!("Starburst"),
                        Athena => todo!("Athena"),
                        Trino => todo!("Trino"),
                        Datafusion => todo!("Datafusion"),
                        Dremio => todo!("Dremio"),
                        Oracle => todo!("Oracle"),
                    };
                Some(metadata_adapter)
            }
        }
    }

    /// Execute `use warehouse [name]` statement for Snowflake.
    /// For other warehouses, this is noop.
    /// Returns whether the connection changed and must be restored.
    pub fn use_warehouse(
        &self,
        conn: &'_ mut dyn Connection,
        warehouse: String,
        node_id: &str,
        token: CancellationToken,

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Do not use the Trino adapter type until it is implemented; switch the profile/target to a supported adapter (Snowflake, Bigquery, Databricks, Redshift, Postgres, DuckDB, Fabric, ClickHouse, Exasol, etc.).
  2. Implement the Trino arm: create a TrinoMetadataAdapter (or reuse a compatible one) and replace `Trino => todo!("Trino")` with `Box::new(TrinoMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>`.
  3. If you only need relation/schema metadata via db_runner, run in sidecar mode (`engine.is_sidecar()`), which returns None before the match is reached.

Example fix

// before
Trino => todo!("Trino"),
// after
Trino => Box::new(TrinoMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>,
Defensive patterns

Strategy: validation

Validate before calling

fn supports_metadata_adapter(t: AdapterType) -> bool {
    matches!(
        t,
        AdapterType::Snowflake | AdapterType::Bigquery | AdapterType::Databricks
            | AdapterType::Spark | AdapterType::Redshift | AdapterType::Salesforce
            | AdapterType::Postgres | AdapterType::DuckDB | AdapterType::LakeCompute
            | AdapterType::Fabric | AdapterType::ClickHouse | AdapterType::Exasol
    )
}
// before calling: assert!(supports_metadata_adapter(adapter.adapter_type()), "metadata adapter not implemented for {:?}", adapter.adapter_type());

Type guard

fn is_implemented_engine(t: &AdapterType) -> Option<&'static str> {
    match t {
        AdapterType::Snowflake => Some("snowflake"),
        AdapterType::Bigquery => Some("bigquery"),
        AdapterType::Redshift => Some("redshift"),
        AdapterType::Postgres => Some("postgres"),
        AdapterType::DuckDB => Some("duckdb"),
        _ => None,
    }
}

Try / catch

// Rust panics are not catchable via Result; wrap only if absolutely necessary:
let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| adapter.metadata_adapter()));
match result {
    Ok(Some(md)) => { /* use md */ }
    Ok(None) => { /* sidecar/mock mode */ }
    Err(_) => eprintln!("metadata adapter not implemented for this adapter type"),
}

Prevention

When it happens

Trigger: Calling `metadata_adapter()` on a DbtAdapter whose adapter_type() is AdapterType::Trino in non-sidecar, non-explicit-mock mode, i.e. any run that resolves metadata hydration for a Trino-backed engine.

Common situations: Running dbt with a Trino profile against this Rust adapter before Trino support is wired up; enabling Trino in configuration while only Snowflake/BigQuery/Databricks/Redshift/etc. are implemented; testing adapter dispatch across all AdapterType enum variants.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/35853127f508e9fd. Report an issue: GitHub.