{"record":{"id":"460e7777235543ec","repo":"dbt-labs/dbt-core","slug":"table-join-e","errorCode":null,"errorMessage":"Table.join: {e}","messagePattern":"Table\\.join: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-agate/src/join.rs","lineNumber":291,"sourceCode":"        // Use take (aka gather, select) with the selection vectors produced above\n        // to materialize the joined result set.\n        let left_row_indices = joined_rows\n            .iter()\n            .map(|&(left_row_idx, _)| left_row_idx.map(|idx| idx as u64))\n            .collect::<UInt64Array>();\n        let right_row_indices = joined_rows\n            .iter()\n            .map(|&(_, right_row_idx)| right_row_idx.map(|idx| idx as u64))\n            .collect::<UInt64Array>();\n\n        let left_batch = self.to_record_batch();\n        let right_batch = right_table.to_record_batch();\n        let mut fields =\n            Vec::with_capacity(left_batch.num_columns() + right_projection_columns.len());\n        let mut arrays = Vec::with_capacity(fields.capacity());\n        let gather = |array: &ArrayRef, indices: &UInt64Array| {\n            arrow::compute::take(array.as_ref(), indices, None)\n                .map_err(|e| Error::new(ErrorKind::InvalidOperation, format!(\"Table.join: {e}\")))\n        };\n\n        for (i, field) in left_batch.schema_ref().fields().iter().enumerate() {\n            // unmatched right rows make every left column nullable\n            fields.push(field.as_ref().clone().with_nullable(true));\n            arrays.push(gather(left_batch.column(i), &left_row_indices)?);\n        }\n        // ```python\n        //         if name in self.column_names:\n        //             column_names.append('%s2' % name)\n        //         else:\n        //             column_names.append(name)\n        // ```\n        for &i in &right_projection_columns {\n            let field = right_batch.schema_ref().field(i);\n            let name = if self.column_names_iter().any(|n| n == field.name()) {\n                format!(\"{}2\", field.name())\n            } else {","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-agate/src/join.rs#L273-L309","documentation":"Generic wrapper around any error produced while materializing the join result in Table.join: the Arrow `take` (gather) with the left/right row-index selection vectors, or RecordBatch construction from the two tables, failed. The underlying Arrow/DataFusion error is re-tagged with the Table.join context; the real cause is in {e}.","triggerScenarios":"Thrown at crates/dbt-agate/src/join.rs:291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded {e} text to identify the actual Arrow failure (usually incompatible schemas between the two tables)","Ensure the joined tables have compatible column types on the key columns","Inspect the two RecordBatches passed to to_record_batch() for schema drift"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}