dbt-labs/dbt-core · error

ReplayStatement::execute_schema

Error message

ReplayStatement::execute_schema

What it means

ReplayStatement::execute_schema is unimplemented in the adbc-record-replay crate. The todo!() placeholder panics when a caller asks the replay statement for its result schema without executing. Schema inference from recorded data is not yet supported.

Source

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

                }

                if let Some(msg) = entry.error {
                    return Err(AdbcError::with_message_and_status(
                        msg,
                        AdbcStatus::Internal,
                    ));
                }

                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(())
    }

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Execute the statement (execute/execute_update) and read the schema from its results instead
  2. Implement execute_schema by replaying the recorded Arrow schema from the capture file
  3. Return a proper Status::NotImplemented error instead of panicking
  4. Perform schema inspection against the real driver, not the replay one

Example fix

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

Strategy: fallback

Validate before calling

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

Try / catch

let schema = if replay_supports_execute_schema(&stmt) {
    stmt.execute_schema()?
} else {
    stmt.execute()?.schema().clone() // fallback: execute and read schema
};

Prevention

When it happens

Trigger: Calling Statement::execute_schema on a statement from the record-replay driver.

Common situations: Client code that inspects result schemas before execution (e.g., for column mapping); frameworks that proactively call execute_schema; metadata-driven pipelines run against a replay database.

Related errors


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