{"record":{"id":"06e3c5d9e297e7f0","repo":"dotnet/machinelearning","slug":"value-cannot-be-null-parameter-supplemetaryjoin","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'supplemetaryJoinColumnNames')","messagePattern":"Value cannot be null\\. \\(Parameter 'supplemetaryJoinColumnNames'\\)","errorType":"validation","errorClass":"System.ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.Data.Analysis/DataFrame.Join.cs","lineNumber":180,"sourceCode":"        /// <param name=\"leftSuffix\"></param> \n        /// <param name=\"rightSuffix\"></param> \n        /// <param name=\"joinAlgorithm\"></param> \n        /// <returns></returns> \n        public DataFrame Merge<TKey>(DataFrame other, string leftJoinColumn, string rightJoinColumn, string leftSuffix = \"_left\", string rightSuffix = \"_right\", JoinAlgorithm joinAlgorithm = JoinAlgorithm.Left)\n        {\n            return Merge(other, new[] { leftJoinColumn }, new[] { rightJoinColumn }, leftSuffix, rightSuffix, joinAlgorithm);\n        }\n\n        private static HashSet<long> Merge(DataFrame retainedDataFrame, DataFrame supplementaryDataFrame,\n            string[] retainedJoinColumnNames, string[] supplemetaryJoinColumnNames,\n            out PrimitiveDataFrameColumn<long> retainedRowIndices, out PrimitiveDataFrameColumn<long> supplementaryRowIndices,\n            bool isInner = false, bool calculateIntersection = false)\n        {\n            if (retainedJoinColumnNames == null)\n                throw new ArgumentNullException(nameof(retainedJoinColumnNames));\n\n            if (supplemetaryJoinColumnNames == null)\n                throw new ArgumentNullException(nameof(supplemetaryJoinColumnNames));\n\n            if (retainedJoinColumnNames.Length != supplemetaryJoinColumnNames.Length)\n                throw new ArgumentException(Strings.MismatchedArrayLengths, nameof(retainedJoinColumnNames));\n\n            Dictionary<long, ICollection<long>> occurrences = GetOccurences(retainedDataFrame, supplementaryDataFrame,\n                retainedJoinColumnNames, supplemetaryJoinColumnNames, out HashSet<long> supplementaryJoinColumnsNullIndices);\n\n            return PerformMerging(retainedDataFrame, retainedJoinColumnNames, occurrences, supplementaryJoinColumnsNullIndices,\n                out retainedRowIndices, out supplementaryRowIndices, isInner, calculateIntersection);\n        }\n\n        private static Dictionary<long, ICollection<long>> GetOccurences(DataFrame retainedDataFrame, DataFrame supplementaryDataFrame,\n            string[] retainedJoinColumnNames, string[] supplemetaryJoinColumnNames, out HashSet<long> supplementaryJoinColumnsNullIndices)\n        {\n            supplementaryJoinColumnsNullIndices = new HashSet<long>();\n\n            // Get occurrences of values in columns used for join in the retained and supplementary dataframes\n","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.Data.Analysis/DataFrame.Join.cs#L162-L198","documentation":"Merge also requires the supplementary (right-side) join-column array to be non-null; when supplemetaryJoinColumnNames is null it throws ArgumentNullException(nameof(supplemetaryJoinColumnNames)) — 'Value cannot be null. (Parameter 'supplemetaryJoinColumnNames')'. Both sides of the merge must specify which columns form the join keys.","triggerScenarios":"Calling df.Merge(other, new[]{\"Id\"}, null) or any public Merge/Join path where the right-side join key array is null.","commonSituations":"Joining on the same-named keys and mistakenly passing null for the right side instead of repeating the array; dynamic key construction returned null; API misuse where left keys were provided but right keys forgotten.","solutions":["Pass a string[] of column names present in the supplementary DataFrame, e.g. new[]{\"Id\"}","If both sides share key names, supply the same array for both parameters","Guard with an argument check before invoking Merge","Catch ArgumentNullException at a boundary and log which side was null"],"exampleFix":"// before\ndf.Merge(other, new[] { \"Id\" }, null);\n// after\nstring[] keys = { \"Id\" };\ndf.Merge(other, keys, keys);","handlingStrategy":"validation","validationCode":"if (rightKeys == null || rightKeys.Length == 0) throw new InvalidOperationException(\"supplemetaryJoinColumnNames required\");","typeGuard":null,"tryCatchPattern":"try { return df.Merge(other, leftKeys, rightKeys); } catch (ArgumentNullException ex) when (ex.ParamName == \"supplemetaryJoinColumnNames\") { throw new ArgumentException(\"Right join keys must be provided\", ex); }","preventionTips":["Reuse one keys array for both sides when key names match","Assert both key arrays non-null in wrapper helpers","Document merge call sites to always specify both sides"],"tags":["argumentnull","join","dataframe"],"backgroundTag":"null-argument","analyzedSha":"7b76e69cf964daeca3f1377af6bc5543284d56c6","analyzedAt":"2026-09-11T12:35:38.930Z","contentChangedAt":"2026-09-11T12:35:38.930Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}