dbt-labs/dbt-core · error

Trino

Error message

Trino

What it means

This is a Rust `todo!()` panic: the `get_relation` dispatcher in dbt-adapter contains `todo!("Trino")` because Trino relation lookup is not yet implemented. Any call resolving a relation with a Trino adapter panics with the message 'Trino'. It is a placeholder for future work, not a data or SQL error.

Source

Thrown at crates/dbt-adapter/src/metadata/get_relation.rs:85

        }
        AdapterType::Spark => {
            spark_get_relation(adapter, state, ctx, conn, schema, identifier, token)
        }
        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);
    }

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Switch to an adapter type with an implemented get_relation until Trino support lands
  2. Implement trino_get_relation querying Trino's INFORMATION_SCHEMA.TABLES (or system metadata) and add it to the match
  3. Pin a dbt-adapter version where the Trino arm is implemented
  4. Add an early capability check so unsupported adapters error at configuration time rather than panicking mid-run

Example fix

// before
AdapterType::Trino => todo!("Trino"),
// after
AdapterType::Trino => trino_get_relation(
    adapter, state, ctx, conn, database, schema, identifier, token,
),
Defensive patterns

Strategy: validation

Validate before calling

if adapter_type == AdapterType::Trino {
    return Err("Trino get_relation is unimplemented; use a supported adapter".into());
}

Type guard

fn trino_ready(t: &AdapterType) -> bool { !matches!(t, AdapterType::Trino) }

Try / catch

std::panic::catch_unwind(|| get_relation(...))
    .map_err(|_| AdapterError::NotImplemented("Trino get_relation"))?

Prevention

When it happens

Trigger: Calling `get_relation` (public) with AdapterType::Trino; the match arm at crates/dbt-adapter/src/metadata/get_relation.rs:85 hits `todo!("Trino")`.

Common situations: Running dbt against a Trino cluster (or Trino-backed catalogs) during a period when the Trino adapter is stubbed; the panic occurs as soon as dbt needs to check whether a relation exists.

Related errors


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