{"record":{"id":"b033cfbeec6fc415","repo":"dbt-labs/dbt-core","slug":"e-b033cf","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"exception","errorClass":"minijinja::Error","httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":1497,"sourceCode":"                            .map(|col| col.value(0).eq_ignore_ascii_case(\"TRANSIENT\"))\n                            .unwrap_or(false)\n                    } else {\n                        false\n                    };\n\n                    // Fold the transient column into the SHOW DYNAMIC TABLES result\n                    let record_batch = table.to_record_batch();\n                    let num_rows = record_batch.num_rows();\n                    let transient_col: ArrayRef =\n                        Arc::new(BooleanArray::from(vec![Some(is_transient); num_rows]));\n                    let mut fields: Vec<Arc<Field>> =\n                        record_batch.schema().fields().iter().cloned().collect();\n                    fields.push(Arc::new(Field::new(\"transient\", DataType::Boolean, true)));\n                    let new_schema = Arc::new(Schema::new(fields));\n                    let mut columns = record_batch.columns().to_vec();\n                    columns.push(transient_col);\n                    let new_batch = RecordBatch::try_new(new_schema, columns).map_err(|e| {\n                        minijinja::Error::new(minijinja::ErrorKind::InvalidOperation, e.to_string())\n                    })?;\n                    AgateTable::from_record_batch(Arc::new(new_batch))\n                } else {\n                    table\n                };\n\n                Ok(Value::from(ValueMap::from([(\n                    Value::from(\"dynamic_table\"),\n                    Value::from_object(table),\n                )])))\n            }\n            Postgres | Bigquery | Databricks | Redshift | Salesforce | Spark | DuckDB\n            | LakeCompute | Fabric | ClickHouse | Exasol | Starburst | Athena | Trino\n            | Datafusion | Dremio | Oracle => {\n                let err = format!(\n                    \"describe_dynamic_table is not supported by the {} adapter\",\n                    adapter_type\n                );","sourceCodeStart":1479,"sourceCodeEnd":1515,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L1479-L1515","documentation":"Inside describe_dynamic_table, after querying the dynamic table a synthetic `transient` boolean column is appended to the Arrow RecordBatch. If RecordBatch::try_new rejects the new schema/columns (e.g. length mismatch or type mismatch), the underlying error message is wrapped as a minijinja InvalidOperation error. This is an internal invariant failure during result construction, not a database problem.","triggerScenarios":"Calling describe_relation → describe_dynamic_table on an adapter whose query returns a batch whose column count/length disagrees with the schema when the transient column is appended — e.g. a zero-row or schema-drifted result from a custom/modified relation query.","commonSituations":"Adapter results whose Arrow schema was altered by a driver update; patched or overridden describe queries returning different column ordering/counts; empty result sets where batch reconstruction fails.","solutions":["Read the wrapped message ({e}) to see the exact Arrow schema error, usually a column length or type mismatch.","Verify the adapter's describe query returns the columns the code expects before the transient column is appended.","Update or pin the Arrow/driver versions if a driver upgrade changed result schemas.","If reproducible, file/inspect the RecordBatch construction path in adapter_impl.rs describe_dynamic_table."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match describe_relation(relation) {\n    Err(e) if e.to_string().contains(\"RecordBatch\") || e.kind() == minijinja::ErrorKind::InvalidOperation => {\n        log::warn!(\"describe_dynamic_table result construction failed: {e}\");\n        fallback_metadata(relation)\n    }\n    other => other,\n}","preventionTips":["Pin and test Arrow/driver versions in CI so result schemas stay stable","Add integration tests for describe queries on empty and edge-case relations","Avoid patching the describe SQL in ways that change column count/order"],"tags":["arrow","internal","schema","adapter"],"backgroundTag":"internal-invariant-violation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}