dbt-labs/dbt-core · error

ReplayStatement::get_parameter_schema

Error message

ReplayStatement::get_parameter_schema

What it means

ReplayStatement::get_parameter_schema is unimplemented in the adbc-record-replay crate. The todo!() placeholder panics when a caller requests the prepared statement's bind-parameter schema. Parameter schema introspection is not available in the replay driver.

Source

Thrown at crates/adbc-record-replay/src/replay.rs:340

                self.recorded_options = entry.options;

                Ok(None)
            }
            StorageType::FileArrowIpc | StorageType::FileParquet => Ok(None),
        }
    }

    fn execute_schema(&mut self) -> AdbcResult<Schema> {
        todo!("ReplayStatement::execute_schema")
    }

    fn execute_partitions(&mut self) -> AdbcResult<adbc_core::PartitionedResult> {
        todo!("ReplayStatement::execute_partitions")
    }

    fn get_parameter_schema(&self) -> AdbcResult<Schema> {
        todo!("ReplayStatement::get_parameter_schema")
    }

    fn prepare(&mut self) -> AdbcResult<()> {
        todo!("ReplayStatement::prepare")
    }

    fn set_sql_query(&mut self, sql: &str) -> AdbcResult<()> {
        self.sql = Some(sql.to_string());
        Ok(())
    }

    fn set_substrait_plan(&mut self, _plan: &[u8]) -> AdbcResult<()> {
        unimplemented!("ReplayStatement::set_substrait_plan")
    }

    fn cancel(&mut self) -> AdbcResult<()> {
        todo!("ReplayStatement::cancel")
    }

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Skip parameter-schema introspection during replay; bind data is not supported anyway (see bind/bind_stream)
  2. Implement get_parameter_schema by persisting the recorded parameter schema at capture time
  3. Return a proper Status::NotImplemented error instead of panicking
  4. Use the real driver for prepared-statement parameter workflows

Example fix

// before
fn get_parameter_schema(&self) -> AdbcResult<Schema> {
    todo!("ReplayStatement::get_parameter_schema")
}
// after
fn get_parameter_schema(&self) -> AdbcResult<Schema> {
    Err(adbc_core::error::Error::with_message(
        Status::NotImplemented,
        "get_parameter_schema is not supported by the replay driver".into(),
    ))
}
Defensive patterns

Strategy: fallback

Validate before calling

fn replay_supports_param_schema(stmt: &ReplayStatement) -> bool {
    false // get_parameter_schema is not implemented in the replay driver
}

Try / catch

let param_schema = if replay_supports_param_schema(&stmt) {
    Some(stmt.get_parameter_schema()?)
} else {
    None // fallback: skip binder construction during replay
};

Prevention

When it happens

Trigger: Calling Statement::get_parameter_schema after prepare() on a record-replay driver statement.

Common situations: Clients that build binders from get_parameter_schema before calling bind; prepared-statement workflows replayed through the record-replay driver; generic ADBC tooling that always introspects parameter schemas.

Related errors


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