dbt-labs/dbt-core · error

Only available for Databricks

Error message

Only available for Databricks

What it means

`dbx_format_add_column_list` formats a column list for ALTER TABLE ... ADD COLUMNS using Databricks-specific syntax, mirroring dbt-databricks' column.py; it panics with `unimplemented!` when the receiver's adapter type is not Databricks. The guard `if self.0 != AdapterType::Databricks` runs before any formatting, so non-Databricks adapters always abort. It exists to make cross-adapter misuse loud rather than silently produce wrong DDL.

Source

Thrown at crates/dbt-adapter/src/column/types.rs:313

        &self,
        name: &str,
        raw_data_type: &str,
    ) -> Result<Column, minijinja::Error> {
        // TODO(serramatutu): why is this Snowflake specific in non-Snowflake specific trait?
        // It seems like it is used by other adapters as well... (tested with BigQuery)
        let mut col = Column::try_from_snowflake_raw_data_type(name, raw_data_type)
            .map_err(|msg| minijinja::Error::new(minijinja::ErrorKind::InvalidArgument, msg))?;
        col._adapter_type = self.0;
        Ok(col)
    }

    /// https://github.com/databricks/dbt-databricks/blob/822b105b15e644676d9e1f47cbfd765cd4c1541f/dbt/adapters/databricks/column.py#L66
    fn dbx_format_add_column_list(
        self: &Arc<Self>,
        columns: &[Column],
    ) -> Result<String, minijinja::Error> {
        if self.0 != AdapterType::Databricks {
            unimplemented!("Only available for Databricks")
        };

        Ok(columns
            .iter()
            .map(|c| format!("{} {}", c.quoted(), c.core_dtype))
            .collect::<Vec<String>>()
            .join(", "))
    }

    /// https://github.com/databricks/dbt-databricks/blob/822b105b15e644676d9e1f47cbfd765cd4c1541f/dbt/adapters/databricks/column.py#L62
    fn dbx_format_remove_column_list(
        self: &Arc<Self>,
        columns: &[Column],
    ) -> Result<String, minijinja::Error> {
        if self.0 != AdapterType::Databricks {
            unimplemented!("Only available for Databricks")
        };

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Dispatch to a platform-appropriate column-list formatter for non-Databricks adapters instead of calling dbx_format_add_column_list.
  2. Add an adapter-type guard before invoking the Databricks-specific formatter.
  3. Verify the materialization invoking this helper is only selected on the Databricks target.

Example fix

// before
let col_list = columns.dbx_format_add_column_list();
// after
let col_list = if adapter_type == AdapterType::Databricks {
    columns.dbx_format_add_column_list()
} else {
    format_standard_add_column_list(columns)
};
Defensive patterns

Strategy: type-guard

Validate before calling

// Rust
if self.0 != AdapterType::Databricks {
    // do not call dbx_format_add_column_list
}

Type guard

fn is_databricks_column(c: &ColumnWrapper) -> bool {
    c.0 == AdapterType::Databricks
}

Try / catch

// Dispatch by adapter type before formatting
let ddl_cols = if is_databricks_column(&columns) {
    columns.dbx_format_add_column_list(&cols)?
} else {
    standard_format_add_column_list(&cols)
};

Prevention

When it happens

Trigger: Calling `dbx_format_add_column_list(columns)` on a Column/type wrapper whose inner AdapterType is not Databricks — e.g. invoking the Databricks column-list formatter while running on Snowflake, Postgres, or BigQuery.

Common situations: Schema-change/append-column macros that dispatch on column methods but reach the Databricks-only formatter on another warehouse; shared models copied from a Databricks project; missing adapter-type dispatch in custom materializations that alter columns.

Related errors


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