{"record":{"id":"b81562374023a7b6","repo":"dbt-labs/dbt-core","slug":"left-key-does-not-have-a-matching-right-key","errorCode":null,"errorMessage":"Left key \"{}\" does not have a matching right key.","messagePattern":"Left key \"(.+?)\" does not have a matching right key\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-agate/src/join.rs","lineNumber":234,"sourceCode":"        //             ...\n        //             rows.append(Row(new_row, column_names))\n        // ```\n        //\n        // Instead of materializing the rows, the joined table is described as pairs of\n        // row indices into the left and the right table. `None` on either side means the\n        // row has no counterpart there and the columns of that side are NULL.\n        let mut joined_rows: Vec<(Option<usize>, Option<usize>)> = Vec::new();\n        for left_row_idx in 0..self.num_rows() {\n            match right_hash.get(&left_tuple_hasher.hash_row(left_row_idx)) {\n                Some(right_row_indices) => {\n                    // one joined row per matching right row\n                    for &right_row_idx in right_row_indices {\n                        joined_rows.push((Some(left_row_idx), Some(right_row_idx)));\n                    }\n                }\n                None => {\n                    if require_match {\n                        return Err(Error::new(\n                            ErrorKind::InvalidOperation,\n                            format!(\n                                \"Left key \\\"{}\\\" does not have a matching right key.\",\n                                left_key.key_of_row(self, left_row_idx)\n                            ),\n                        ));\n                    }\n                    if !join_type.is_inner() {\n                        joined_rows.push((Some(left_row_idx), None));\n                    }\n                }\n            }\n        }\n\n        // ```python\n        //     # Full outer join\n        //     if full_outer:\n        //         left_set = set(left_data)","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-agate/src/join.rs#L216-L252","documentation":"Fires during the hash-join row matching in Table.join: a column listed in left_key has no counterpart in right_key, so the join cannot pair rows. The message interpolates the offending left key name; the fault is mismatched key column lists in the Jinja join() call.","triggerScenarios":"Thrown at crates/dbt-agate/src/join.rs:234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give right_key the same number and order of column names as left_key","Check spelling and case of the key column names on both tables","Verify both key columns exist in their respective tables before joining"],"exampleFix":null,"handlingStrategy":"validation","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"}