dbt-labs/dbt-core · error

grants not implemented

Error message

grants not implemented

What it means

standardize_grants_dict panics for adapters with no grants normalization branch (Salesforce, Spark, Fabric, ClickHouse, Starburst, Athena, Trino, Datafusion, Dremio, Oracle). The method converts a raw `SHOW GRANTS` result into dbt's normalized grant dict; the Rust port only implements per-dialect parsing for the other adapters.

Solutions

  1. Remove `grants:` config from models using these adapters.
  2. Run grant-bearing models on an adapter with implemented grant parsing (Redshift, Snowflake, Databricks, Postgres, BigQuery, etc.).
  3. Implement a grants dict normalizer for the missing dialects in adapter_impl.rs (~line 3138).

Example fix

// before
Salesforce | Spark | Fabric | ClickHouse | ... | Oracle => {
    unimplemented!("grants not implemented")
}
// after
Salesforce | Spark | Fabric | ClickHouse | ... | Oracle => {
    Err(AdapterError::NotImplemented("grants".into()))
}
Defensive patterns

Strategy: validation

Validate before calling

if config.grants.is_some() && ["salesforce","spark","fabric","clickhouse","starburst","athena","trino","datafusion","dremio","oracle"].contains(&adapter_type.as_str()) {
    return Err("grants not implemented for this adapter".into());
}

Type guard

fn supports_grants(adapter_type: &AdapterType) -> bool {
    !matches!(adapter_type, AdapterType::Salesforce | AdapterType::Spark | AdapterType::Fabric | AdapterType::ClickHouse | AdapterType::Starburst | AdapterType::Athena | AdapterType::Trino | AdapterType::Datafusion | AdapterType::Dremio | AdapterType::Oracle)
}

Prevention

When it happens

Trigger: Grant normalization during `on-commit` grant application or `dbt` grant auditing on the listed adapters; currently also reachable from unit tests (test_redshift_standardize_grants_dict_legacy etc. exercise other branches).

Common situations: Configuring `grants:` on models/snapshots with any of the listed adapters in the Rust engine.

Related errors


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

Appendix: source

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

                let object_type_cols = record_batch.column_values::<StringArray>("ObjectType")?;

                let mut result = IndexMap::new();
                for i in 0..record_batch.num_rows() {
                    let privilege = privilege_cols.value(i);
                    let grantee = grantee_cols.value(i);
                    let object_type = object_type_cols.value(i);

                    if object_type == "TABLE" && privilege != "OWN" {
                        let list = result.entry(privilege.to_string()).or_insert_with(Vec::new);
                        list.push(grantee.to_string());
                    }
                }

                Ok(result)
            }
            Salesforce | Spark | Fabric | ClickHouse | Starburst | Athena | Trino | Datafusion
            | Dremio | Oracle => {
                unimplemented!("grants not implemented")
            }
        }
    }

    /// Join `SHOW TABLES FROM SCHEMA` metadata with `SVV_REDSHIFT_COLUMNS` to build the base
    /// catalog used when Redshift datasharing is enabled. The SVV view is leader-only and
    /// cannot be joined to `SHOW` results in SQL, so the catalog macro fetches both and passes
    /// them here for an in-memory join.
    pub fn build_catalog_from_show_tables_and_svv_columns(
        &self,
        show_tables_results: &[Arc<AgateTable>],
        svv_columns: Arc<AgateTable>,
    ) -> AdapterResult<AgateTable> {
        match self.adapter_type() {
            Redshift => {
                let show_tables_batches: Vec<Arc<RecordBatch>> = show_tables_results
                    .iter()
                    .map(|table| table.original_record_batch())

View on GitHub (pinned to 0267ce9170)