dbt-labs/dbt-core · error

Athena

Error message

Athena

What it means

This is a Rust `todo!()` panic: `get_relation` in dbt-adapter has no Athena implementation yet, so any Athena adapter relation lookup hits the `todo!("Athena")` arm and panics. It marks a registered AdapterType whose metadata query is still unwritten, not a query or connectivity failure.

Source

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

            salesforce_get_relation(adapter, state, ctx, conn, database, schema, identifier)
        }
        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. Use an adapter type that implements get_relation until Athena support ships
  2. Implement an athena_get_relation function (typically via the Glue Data Catalog or Athena INFORMATION_SCHEMA) and wire it into the match arm
  3. Downgrade/pin to a release where the Athena path is implemented or excluded
  4. Fail fast at adapter setup by validating that the chosen adapter type supports metadata lookups

Example fix

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

Strategy: validation

Validate before calling

if matches!(adapter_type, AdapterType::Athena) {
    return Err("Athena get_relation is not implemented in this dbt-adapter version".into());
}

Type guard

fn athena_supported(t: &AdapterType) -> bool { !matches!(t, AdapterType::Athena) }

Try / catch

let result = std::panic::catch_unwind(|| get_relation(...));
match result {
    Ok(r) => r,
    Err(_) => Err(AdapterError::NotImplemented("Athena get_relation")),
}

Prevention

When it happens

Trigger: Calling `get_relation` (public) with an Athena adapter; the dispatch at crates/dbt-adapter/src/metadata/get_relation.rs:84 executes `todo!("Athena")`.

Common situations: Pointing dbt at AWS Athena before Athena relation-resolution support landed; users configure Athena credentials and a workgroup, then dbt panics the first time it must resolve an existing relation (e.g. checking if a model table exists).

Related errors


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